-
Notifications
You must be signed in to change notification settings - Fork 87
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
integration test for extra warResources #450
Conversation
<prop1>hello</prop1> | ||
<prop2>goodbye</prop2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 properties in the pom for filtering
<webResources> | ||
<resource> | ||
<directory>${project.basedir}/src/main/webResource-filtering</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</webResources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we had no test coverage of this.
There appears to be only a few plugins webResources
and fewer using filtering, but there could be closed source ones and this is publicly documented so leaving the functionallity for now.
// code uses plexus not maven so escapes are not supported. | ||
assert globalConfigHelp.contains("\\\${prop1\\} hello"); | ||
assert globalConfigHelp.contains("\\@prop2\\@ goodbye"); | ||
// code claims to add System properties but this fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maven-hpi-plugin/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
Lines 382 to 401 in b105426
private Properties getBuildFilterProperties() | |
throws MojoExecutionException { | |
// System properties | |
Properties filterProperties = new Properties(System.getProperties()); | |
// Project properties | |
filterProperties.putAll(project.getProperties()); | |
for (String filter : filters) { | |
try { | |
Properties properties = PropertyUtils.loadProperties(new File(filter)); | |
filterProperties.putAll(properties); | |
} | |
catch (IOException e) { | |
throw new MojoExecutionException("Error loading property file '" + filter + "'", e); | |
} | |
} | |
return filterProperties; | |
} |
\@prop2\@ @prop2@ | ||
and these will be replaced at build time | ||
it is even possible to use system properties | ||
\@java.class.version\@ ${java.class.version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly not the best system property to use...
java.vendor.url
could be better and checking the replacement starts with https://
but as this currently does not work there is not much point in changing...
IT in preparation for updating filtering code.