Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven Assembly Plugin, Uploading the right zip file
    primarykey
    data
    text
    <p>I have something like the following where I need to generate 2 zip files and finally zip them up to another zip file:</p> <pre><code> &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;assembly1&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt; &lt;finalName&gt;assembly1&lt;/finalName&gt; &lt;descriptors&gt; &lt;descriptor&gt;assembly1.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;attach&gt;true&lt;/attach&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;assembly2&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt; &lt;finalName&gt;assembly2&lt;/finalName&gt; &lt;descriptors&gt; &lt;descriptor&gt;assembly2.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;attach&gt;true&lt;/attach&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;assembly3&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt; &lt;finalName&gt;assembly3&lt;/finalName&gt; &lt;descriptors&gt; &lt;descriptor&gt;assembly3.xml&lt;/descriptor&gt; &lt;/descriptors&gt; &lt;attach&gt;true&lt;/attach&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>What I am trying to do is creating 2 zip files called assembly1.zip and assembly2.zip, finally zip these 2 zip files into assembly3.zip</p> <p>Under the target folder, I see the zip files created and in assembly3.zip, I see the assembly1 and 2 zip files as well.</p> <p>When Maven uploads to the local repo, it randomly picks up one of the zip files and what I want to be uploaded is the assembly3.zip file.</p> <p>This is what I see in the Maven log:</p> <pre><code>[INFO] --- maven-assembly-plugin:2.2-beta-5:single (assembly1) @ MyTestWar --- [INFO] Reading assembly descriptor: assembly1.xml [INFO] Building zip: C:\MyTest\target\assembly1.zip [INFO] --- maven-assembly-plugin:2.2-beta-5:single (assembly2) @ MyTestWar --- [INFO] Reading assembly descriptor: assembly2.xml [INFO] Building zip: C:\MyTest\target\assembly2.zip **[WARNING] Artifact com.test:MyTestWar:zip:1.0.0.11-SNAPSHOT already attached to project, ignoring duplicate** [INFO] --- maven-assembly-plugin:2.2-beta-5:single (assembly3) @ MyTestWar --- [INFO] Reading assembly descriptor: assembly3.xml [INFO] Building zip: C:\MyTest\target\assembly3.zip **[WARNING] Artifact com.test:MyTestWar:zip:1.0.0.11-SNAPSHOT already attached to project, ignoring duplicate** **[INFO] Installing C:\MyTest\target\assembly1.zip to C:\Users\myUserName\.m2\repository\ com\test\MyTestWar\1.0.0.11-SNAPSHOT\MyTestWar-1.0.0.11-SNAPSHOT.zip** </code></pre> <p>This is my Maven install plugin where I try to upload Assembly3.zip</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;install&lt;/phase&gt; &lt;id&gt;zip-upload&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;install-file&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;packaging&gt;zip&lt;/packaging&gt; &lt;artifactId&gt;Assembly3&lt;/artifactId&gt; &lt;groupId&gt;${project.groupId}&lt;/groupId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;file&gt;${project.build.directory}/assembly3.zip&lt;/file&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>Though it is mentioned that it got to upload assembly3.zip, for some reason Maven is picking up assembly1.zip.</p> <p>Also I am interested in those Warnings.</p> <p>Any help in getting rid of the warnings as well as uploading Assembly3.zip is highly appreciated.</p> <p>Thanks</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