我想将hibernate3-maven-plugin放在我的父pom中,如果给定文件不存在于子模块中,则跳过执行.
I want to put the hibernate3-maven-plugin in my parent pom and have execution skipped in child modules if a given file does not exist in that module.
有什么办法吗?
到目前为止,我必须这样做:
Up to now, I have had to do this:
<plugin> ... <configuration> <skip>true</skip> <propertyfile>target/test-classes/jdbc.properties</propertyfile> </configuration> </plugin>在父POM中,并且:
<plugin> ... <configuration> <skip>${maven.test.skip}</skip> </configuration> </plugin>在我要执行的所有子POM中.即那些实际上拥有jdbc.properties文件的人.
In all child POMs where I want it to execute. I.E Those actually having a jdbc.properties file.
推荐答案您可以使用配置文件执行此操作,但是我想您可能不想在父项目中运行它,这可能会出现问题. br> 以下是个人资料上的一些链接:
You may be able to do this with profiles, but I suppose you'd probably not want to run it in the parent project, which may be problematic. Here are some links on profiles:
- maven.apache/guides/introduction /introduction-to-profiles.html
- www.sonatype/books/mvnref -book/reference/profiles.html
- >: //mindthegab/2008/12/02/howto-give-your-multimodule-maven-build-subprojectenvironment-specific-behavior/
- maven.apache/guides/introduction/introduction-to-profiles.html
- www.sonatype/books/mvnref-book/reference/profiles.html
- mindthegab/2008/12/02/howto-give-your-multimodule-maven-build-subprojectenvironment-specific-behavior/
这个问题,存在类似的问题,无法通过配置文件解决: activate-different-maven-profiles-depending-on-current-module
This question, had a similar issue and was not able to solve it with profiles: activate-different-maven-profiles-depending-on-current-module
更多推荐
如果文件不存在,则跳过Maven插件的执行
发布评论