@Kim is closest, but not quite yet. I do not think adding --fail-never is correct, even through this to do the job.
The verify command calls a lot of plugins to execute, which is the problem (for me) - I don't think they should be executed when all I want to do is install the dependencies! I also have multi-module build and javascript build, so this complicates the setup even more.
But running just verify not enough, because if you run install in the following commands, more plugins will be used - which means more dependencies to download - maven refuses to download them otherwise. Relevant reading: Maven: introduction to the assembly life cycle
You must find which properties disable each plugin and add them one at a time so that they do not break your build.
WORKDIR /srv # cache Maven dependencies ADD cli/pom.xml /srv/cli/ ADD core/pom.xml /srv/core/ ADD parent/pom.xml /srv/parent/ ADD rest-api/pom.xml /srv/rest-api/ ADD web-admin/pom.xml /srv/web-admin/ ADD pom.xml /srv/ RUN mvn -B clean install -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip -Djacoco.skip -Dmaven.gitcommitid.skip -Dspring-boot.repackage.skip -Dmaven.exec.skip=true -Dmaven.install.skip -Dmaven.resources.skip
but some plugins are not so easy to miss - I'm not a maven expert (so I don’t know why he ignores the cli option - this may be a mistake), but the following works as expected for org.codehaus.mojo:exec-maven-plugin
<project> <properties> <maven.exec.skip>false</maven.exec.skip> </properties> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.3.2</version> <executions> <execution> <id>yarn install</id> <goals> <goal>exec</goal> </goals> <phase>initialize</phase> <configuration> <executable>yarn</executable> <arguments> <argument>install</argument> </arguments> <skip>${maven.exec.skip}</skip> </configuration> </execution> <execution> <id>yarn run build</id> <goals> <goal>exec</goal> </goals> <phase>compile</phase> <configuration> <executable>yarn</executable> <arguments> <argument>run</argument> <argument>build</argument> </arguments> <skip>${maven.exec.skip}</skip> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
pay attention to the explicit <skip>${maven.exec.skip}</skip> - other plugins select this from the cli parameters, but not this one (neither -Dmaven.exec.skip=true nor -Dexec.skip=true work itself by oneself)
Hope this helps
Filip procházka
source share