Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding file to jar during maven build
    primarykey
    data
    text
    <p>I am trying to add a license file to all of my jars when executing a maven build. I have the license on each class file, but I am looking to add License.txt to each META-INF folder within each jar</p> <p>My project has a master pom, which has half dozen modules, those modules then have modules of their own, and eventually get to a project that generates a /target/&lt;.jar-file>. The build and the class level licenses are working, I am just looking to add a physical License.txt into the META-INF folder.</p> <p>My file is stored (relative to the master POM) in /src/resources/src-license.txt. I really need the automated method to ensure that if/when the license changes, I dotn have to update 50 files, I can just update the one, which is then copied out to the other locations.</p> <p>I have tried using</p> <pre><code>&lt;build&gt; &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt; &lt;resources&gt; &lt;resource&gt; &lt;directory&gt;src/resources&lt;/directory&gt; &lt;targetPath&gt;/META-INF&lt;/targetPath&gt; &lt;includes&gt; &lt;include&gt;src-license.txt&lt;/include&gt; &lt;/includes&gt; &lt;/resource&gt; &lt;/resources&gt; .... &lt;/build&gt; </code></pre> <p>But that doesnt seem to do the trick. I have also tries some alternatives to the output path, such as ${project.build.outputDirectory}/META-INF, or */META_INF, also to no avail. Does anyone have some experience on how to accomplish this? Thanks</p> <p>Also, I use the maven-license-plugin to ensure that each class file has the license info pasted into it, and that functions as intended. But again, that inside the class files, I am looking for an external .txt file in each &lt;*.jar>/META-INF/</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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