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

Fix duplicate application.ini mappings when both BASH and BAT plugins are used #1056

Merged
merged 1 commit into from
Oct 29, 2017

Conversation

dwickern
Copy link
Collaborator

Now that the BAT plugin supports application.ini, when you use both plugins together you get duplicate mappings:

[info] * (target/universal/tmp/conf/application.ini,conf/application.ini)
[info] * (target/universal/tmp/conf/application.ini,conf/application.ini)

This isn't necessarily a problem, but unzipping the universal dist will try to create the file twice:

$ unzip app-1.0-SNAPSHOT.zip
Archive:  app-1.0-SNAPSHOT.zip
  inflating: app-1.0-SNAPSHOT/conf/application.ini
replace app-1.0-SNAPSHOT/conf/application.ini? [y]es, [n]o, [A]ll, [N]one, [r]ename:

This change filters out the duplicate mapping. Alternatively maybe it would be better to have an ApplicationIniPlugin which is a dependency of both the BatStartScriptPlugin and BashStartScriptPlugin

@dwickern dwickern force-pushed the duplicate-application-ini branch from 15d685c to c3e6ca8 Compare October 25, 2017 21:38
@muuki88 muuki88 added universal Zip, tar.gz, tgz and bash issues windows labels Oct 26, 2017
Copy link
Contributor

@muuki88 muuki88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this :)

"application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'"
)
val filteredMappings = universalMappings.filter {
case (`configFile`, `pathMapping`) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting implementation. I didn't get at first what was happening here. The second call to the method
will filter the already created config file.

@muuki88 muuki88 merged commit 6c9351c into sbt:master Oct 29, 2017
muuki88 added a commit that referenced this pull request Oct 29, 2017
@muuki88
Copy link
Contributor

muuki88 commented Oct 29, 2017

nevermind the revert branch. I overlooked that the validateBash tests were failing, but it was a travis issue.

@muuki88
Copy link
Contributor

muuki88 commented Oct 29, 2017

@dwickern dwickern deleted the duplicate-application-ini branch November 2, 2017 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants