Commit 6c9351c 1 parent af21f71 commit 6c9351c Copy full SHA for 6c9351c
File tree 1 file changed +18
-10
lines changed
src/main/scala/com/typesafe/sbt/packager/archetypes/scripts
1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,25 @@ trait ApplicationIniGenerator {
21
21
val pathMapping = cleanApplicationIniPath(location)
22
22
// Do not use writeLines here because of issue #637
23
23
IO .write(configFile, (" # options from build" +: javaOptions).mkString(" \n " ))
24
- val hasConflict = universalMappings.exists {
25
- case (file, path) => file != configFile && path == pathMapping
26
- }
27
- // Warn the user if he tries to specify options
28
- if (hasConflict) {
29
- log.warn(" --------!!! JVM Options are defined twice !!!-----------" )
30
- log.warn(
31
- " application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'"
32
- )
24
+ val filteredMappings = universalMappings.filter {
25
+ case (`configFile`, `pathMapping`) =>
26
+ // ignore duplicate application.ini mappings with identical contents
27
+ // for example when using both the BASH and BAT plugin
28
+ false
29
+
30
+ case (_, `pathMapping`) =>
31
+ // specified a custom application.ini file *and* JVM options
32
+ // TODO: merge JVM options into the existing application.ini?
33
+ log.warn(" --------!!! JVM Options are defined twice !!!-----------" )
34
+ log.warn(
35
+ " application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'"
36
+ )
37
+ false
38
+
39
+ case _ =>
40
+ true
33
41
}
34
- (configFile -> pathMapping) +: universalMappings
42
+ (configFile -> pathMapping) +: filteredMappings
35
43
36
44
}
37
45
.getOrElse(universalMappings)
You can’t perform that action at this time.
0 commit comments