我正在使用一个使用maven进行构建的项目。我想要做的是跳过测试依赖。基本上运行maven构建而不存在我的maven存储库中的工件。
I am working on a project that use maven for building. What I am trying to do is to skip the test dependency. Basically running the maven build without the presence of artifact in my maven repository.
例如
<artifactId>example</artifactId> <scope>test</scope>这是从我的项目的pom文件,我必须maven构建我的项目,而没有工件 example
This is from the pom file of my project and I have to maven build my project without having artifact example.
我已经搜索过解决方案,例如使用-DskipTests = true或-Dmaven.test.skip = true。在我的情况下,他们没有跳过测试的运行,但仍然抱怨缺少依赖文件。
I have searched for solution such as use "-DskipTests=true" or "-Dmaven.test.skip=true". In my case they did skip the running of the tests but it still complains missing dependency file.
有没有人知道运行maven构建的方法,而不必具有测试工件maven仓库?
Does anyone know a way to run maven build without having to have test artifact in the maven repository?
谢谢。
推荐答案请参阅 jira.codehaus/browse/MNG-4192 。我认为唯一的办法是将测试范围的依赖关系移动到Maven配置文件中。
See jira.codehaus/browse/MNG-4192. I think the only way around it is to move the test-scoped dependency into a Maven profile.
更多推荐
跳过Maven测试依赖关系
发布评论