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

Overwrite external config options in pom.xml #48

Closed
tofi86 opened this issue Dec 8, 2016 · 6 comments
Closed

Overwrite external config options in pom.xml #48

tofi86 opened this issue Dec 8, 2016 · 6 comments

Comments

@tofi86
Copy link
Contributor

tofi86 commented Dec 8, 2016

It would be great to have the following available in your plugin:

<configuration>
	<infile>${project.basedir}/src/build/launch4j-config.xml</infile>
	
	<versionInfo>
		<fileVersion>${my.version.number}.${my.build.number}</fileVersion>
		<txtFileVersion>${my.version.number}</txtFileVersion>
		<productVersion>${my.version.number}.${my.build.number}</productVersion>
		<txtProductVersion>${my.version.number}</txtProductVersion>
	</versionInfo>
</configuration>

so to be able to use an external config file but override several configuration options like version numbers, which are naturally handled within maven.

With the launch4j ant task, this is possible like this:

<launch4j
	jar="${out.dir}/my.jar"
	outfile="${out.dir}/my.exe"
	configFile="${build.dir}/launch4j/launch4j-config.xml"
	fileVersion="${program.version.number}"
	txtFileVersion="${program.version.txtNumber}"
	productVersion="${program.version.number}"
	txtProductVersion="${program.version.txtNumber}"
/>

Any chance to include this in a future version?

Thanks,
Tobias

@tofi86
Copy link
Contributor Author

tofi86 commented Dec 8, 2016

Also pinging @adamdec as he implemented the original <infile> support in PR #32.
Any ideas?

@adamdec
Copy link

adamdec commented Dec 9, 2016

Can you please prepare PR?

@tofi86
Copy link
Contributor Author

tofi86 commented Dec 10, 2016

Okay, I can give it a try. Seems easier than I thought—also the ANT task solves this a bit hacky: https://sourceforge.net/p/launch4j/git/ci/master/tree/src/net/sf/launch4j/ant/Launch4jTask.java#l83

@tofi86
Copy link
Contributor Author

tofi86 commented Dec 11, 2016

Created Pull Request #49 for this. Would love to see this integrated in the next version!

@myron0815
Copy link

Hej... does this work as expected (in maven)?
Having above configuration... but according to source, i can ONLY override jar/outfile/ and SOME named versioninfo, but not other values?! Why not all?!

Why not just load file in infile.exists(), skip the else and overwrite all with POM values?
(Or the other way round, new config = pom values, and only override from xml)

Got some NPE, b/c i didn't have the specified in xml (since i moved it to pom)

@lukaszlenart
Copy link
Collaborator

@myron0815 see discussion under #49

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

4 participants