Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So it turns out Maven creates a "snapshot" jar that gets included in the lib folder inside the Zip archive. That snapshot jar contains the config files injected with the right values. In other words if you load your config files using the class loader instead of a file system reference it should work. </p> <p>At any rate I was told not to put the config files at the root of the Zip archive. So the config files that Maven was just pushing in the archive without injecting them shouldn't even be there in the first place in my case. </p> <p>But here is the new content of my src.xml file that gets included within the pom.xml:</p> <pre><code>&lt;assembly&gt; &lt;id&gt;bin&lt;/id&gt; &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt; &lt;formats&gt; &lt;format&gt;zip&lt;/format&gt; &lt;/formats&gt; &lt;fileSets&gt; &lt;fileSet&gt; &lt;directory&gt;src/main/bin&lt;/directory&gt; &lt;outputDirectory&gt;/bin&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;**/*.sh&lt;/include&gt; &lt;/includes&gt; &lt;fileMode&gt;777&lt;/fileMode&gt; &lt;/fileSet&gt; &lt;fileSet&gt; &lt;directory&gt;lib&lt;/directory&gt; &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;**/*.jar&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;!-- Wrapper files --&gt; &lt;fileSet&gt; &lt;directory&gt;lib/wrapper&lt;/directory&gt; &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;**/*&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;fileSet&gt; &lt;directory&gt;src/main/bin/wrapper&lt;/directory&gt; &lt;outputDirectory&gt;/bin/wrapper&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;**/*&lt;/include&gt; &lt;/includes&gt; &lt;fileMode&gt;777&lt;/fileMode&gt; &lt;/fileSet&gt; &lt;fileSet&gt; &lt;directory&gt;src/main/conf&lt;/directory&gt; &lt;outputDirectory&gt;conf&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;**/*&lt;/include&gt; &lt;/includes&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;dependencySets&gt; &lt;dependencySet&gt; &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt; &lt;includes&gt; &lt;include&gt;*:jar:*&lt;/include&gt; &lt;/includes&gt; &lt;excludes&gt; &lt;exclude&gt;*:sources&lt;/exclude&gt; &lt;/excludes&gt; &lt;/dependencySet&gt; &lt;/dependencySets&gt;&lt;/assembly&gt; </code></pre> <p>That still outputs a jar and a zip archive, but since the zip contains the snapshot jar everything should be fine now. </p> <p>EXCEPT... (and that might be for another post so let me know if I go off topic for this question)</p> <p>That the values injected in the config files aren't the one from the profile within my POM.xml. They are the ones from my settings.xml that lives in my .m2 folder. But turning off the activation in the settings.xml profile doesn't seem to solve this issue:</p> <pre><code>&lt;activation&gt; &lt;activeByDefault&gt;false&lt;/activeByDefault&gt; &lt;/activation&gt; </code></pre> <p>Again here is the command line I run:</p> <pre><code>mvn -Denv-prod clean generate-sources package </code></pre> <p>Where "env-prod" is the profile in the pom.xml containing the values to be injected.</p> <p>Any idea?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload