Question

I'm using the maven-dependency-plugin to gather all of the dependencies for my application and then package them up in a ZIP file with the maven-assembly-plugin. That part is all working great.

However, when I do mvn deploy, it deploys the ZIP file to my Archiva server, which I don't want. I'd just like to have the JAR's deployed there individually.

Is there any way to prevent the upload of the ZIP file?

Here are the relevant sections of my POM:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>${project.build.directory}/lib</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.3</version>
  <executions>
    <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
      <configuration>
        <finalName>myProject-${project.version}</finalName>
        <outputDirectory>../</outputDirectory>
        <descriptors>
          <descriptor>src/main/assembly/assembly.xml</descriptor>
        </descriptors>
      </configuration>
    </execution>
  </executions>
</plugin>
Was it helpful?

Solution

Try adding

<attach>false</attach>

to maven-assembly-plugin's configuration section. This should prevent the generated ZIP from being deployed. See http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top