Maven部署不上传测试jar [英] Maven deploy not to upload test jar
问题描述
当我们运行maven deploy命令时,我想它只上传项目jar文件而不是测试jar文件。有没有办法实现?
实际上,测试jar文件默认情况下不会构建。您很可能使用附加的测试明确构建它们。如果是这样,您可以从项目中删除该配置,您应该很好去。
查找类似以下内容的部分,您可以删除相同的内容。 p>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-jar-plugin< / artifactId>
< version> 2.2< / version>
<执行>
< execution>
< goals>
< goal> test-jar< / goal>
< / goals>
< / execution>
< / executions>
< / plugin>
如果没有上述,测试将继续运行在您的项目中。
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?
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.
这篇关于Maven部署不上传测试jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!