Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutom assets folder not resolved in current module scope #38

Closed
ogerardin opened this issue Jun 14, 2020 · 7 comments
Closed

Cutom assets folder not resolved in current module scope #38

ogerardin opened this issue Jun 14, 2020 · 7 comments

Comments

@ogerardin
Copy link
Contributor

ogerardin commented Jun 14, 2020

I have a main POM with submodules, one of which is dedicated to building distribution packages and installers. So my structure is like:

pom.xml
module1
    pom.xml
...
dist
    pom.xml

The javapackager plugin is of course in the dist/pom.xml, but if I want to provide a custom icon I must put the assets folder at the main pom level:

pom.xml
assets
    mac
        xxx.icns
    ...
module1
    pom.xml
...
dist
    pom.xml

I suggest that customized assets should be resolved in the scope of the plugin's current module, i.e.:

pom.xml
module1
    pom.xml
...
dist
    assets
        mac
            xxx.icns
        ...
    pom.xml
@fvarrui
Copy link
Owner

fvarrui commented Jun 15, 2020

Hi @ogerardin,
now it's using Maven execution dir as base to locate assets ... do you think it would be a good idea to use ${project.basedir} property as the parent of assets directory?

@ogerardin
Copy link
Contributor Author

now it's using Maven execution dir as base to locate assets ... do you think it would be a good idea to use ${project.basedir} property as the parent of assets directory?

Definitely :) The assets folder should be relative to the projet using the plugin.
If you want to keep compatibility you can search both places.
I was also thinking if the assets folder is a resource (i.e. in src/main/resources), it will be copied to the target dir and so you could also look in ${project.build.directory}

@fvarrui
Copy link
Owner

fvarrui commented Jun 15, 2020

I think to use ${basedir} as parent folder for assets and include a new property (maybe called assetsDir) to specify a different assets folder location.

I'm not sure if put assets in src/main/resources is a good idea, because maybe you don't want to distribute .icns or .ico files, which are only necessary to build installation artifacts.

@ogerardin
Copy link
Contributor Author

Good idea to add a property, now you can only do it for icon!
You're right if it's a resource it will end up in the JAR which we probably don't want...

@fvarrui
Copy link
Owner

fvarrui commented Jun 15, 2020

New property assetsDir added, so now it allows to customize assets folder, where icons and custom templates are stored. This property points to ${basedir}/assets by default to maintain backward compatibility. Now it has to resolve assets in the scope of the plugin's current module.

Please, could you give a try to 1.0.3-SNAPSHOT?

@ogerardin
Copy link
Contributor Author

Yep it works :)

I replaced
<iconFile>${project.basedir}/assets/mac/X-Plane Manager.icns</iconFile>
with
<assetsDir>${project.basedir}/assets</assetsDir>

And since it is now the default I was able to remove it completely!

@fvarrui fvarrui closed this as completed Jun 15, 2020
@fvarrui
Copy link
Owner

fvarrui commented Jun 15, 2020

When we definitely fixed all your issues, I’ll release v1.0.3 to Maven Central. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants