Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven deploy not to upload test jar

We have project with lot of precanned test files, so obviously the test-jar file is very big. Since no one uses test jar(at least in out project), we don't gain any benefit by uploading it.

When we run the maven deploy command, I want it to only upload the project jar file and not the test jar file. Is there a way to achieve that?

like image 658
Ravi Avatar asked Nov 23 '11 17:11

Ravi


1 Answers

Actually the test jar files do not get built by default. It is likely that you are building them explicitly using attached tests. If so, you can remove that config from your project and you should be good to go.

Look for a section like the following and you can remove the same.

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <version>2.2</version>
   <executions>
     <execution>
       <goals>
         <goal>test-jar</goal>
       </goals>
     </execution>
   </executions>
 </plugin>

Tests will continue to run on your project without the above.

like image 92
Raghuram Avatar answered Oct 13 '22 10:10

Raghuram