Tuesday 30 September 2008

Excluding the pom.xml from a maven jar

To prevent Maven 2 adding the pom.xml file to your generated jar (you may not want to distribute build information, SCM information, storepass details etc) you can do the following:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  ...
  <configuration>
     ...
     <archive>
       <addMavenDescriptor>false</addMavenDescriptor>
     <archive>
     ...
  </configuration>
</plugin>


No comments: