Release plugin error - no POM in this directory - maven

I am trying to use the maven release plugin but I have an error that prevents me to use it.
My folder structure:
+root
+parent
pom.xml
+projectA
pom.xml
+projectB
pom.xml
pom.xml
root/parent/pom.xml
<project ...>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>throttling</name>
<url>http://maven.apache.org</url>
...
<scm>
<connection>scm:hg:https://code.google.com/***</connection>
</scm>
<distributionManagement>
<repository>
<id>deployment</id>
...
</repository>
<snapshotRepository>
<id>deployment</id>
...
</snapshotRepository>
</distributionManagement>
</project>
root/pom.xml
<project ...>
<artifactId>throttling-modules</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>throttling</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath />
</parent>
<modules>
<module>projectA</module>
<module>projectB</module>
</modules>
<scm>
<connection>scm:hg:https://code.google.com/***</connection>
</scm>
<distributionManagement>
<repository>
<id>deployment</id>
...
</repository>
<snapshotRepository>
<id>deployment</id>
...
</snapshotRepository>
</distributionManagement>
</project>
root/projectA/pom.xml
<project ...>
<parent>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath />
</parent>
<artifactId>thr-common</artifactId>
<version>1.0-SNAPSHOT</version>
<name>thr-common</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
...
</project>
I executed the command 'mvn release:prepare' that ran fine.
After that I executed the 'mvn release:perform' but I got the next error message
(mvn release:perform -Dusername=???? -Dpassword=????? -DconnectionUrl=scm:hg:https://code.google.com/???):
[INFO] Checking out the project to perform the release ...
[INFO] Removing D:\work\throttling\code_google\***\throttling\parent\target\checkout
[INFO] EXECUTING: cmd.exe /X /C "hg clone -r release_parent-1.1 https://***:***#code.google.com/*** D:\work\throttling\code_google\***\throttling\parent\target\checkout"
[INFO] EXECUTING: cmd.exe /X /C "hg locate"
[INFO] Executing goals 'deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\work\throttling\code_google\***\throttling\parent\target\checkout). Please verify you invoked Maven from the correct directory. -> [Help 1]
The folder structure in throttling\parent\target
+throttling\parent\target
+checkout
+throttling
+parent
+projectA
+projectB
Thanks,
V.

I could solve the problem in the end, the path of the parent pom had to be defined in the parent pom XML.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>parent/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Related

How to skip failsafe execution for pom packaging?

I wanted to configure failsafe with failIfNoTests in a parent pom because we are currently upgrading Spring Boot in our microservices, and tests might not be properly detected if they are still using JUnit 4 (you need to migrate them or use junit-vintage).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
The problem however is that this causes the plugin to also run in the build of the parent pom. I don’t want to put this in <pluginManagement> because I want to make sure that the plugin is running in child projects (otherwise they still have to declare the plugin and it might be forgotten).
Is there a way to prevent the failsafe plugin from running with pom packaging?
Note that I did the same with surefire, but there is no issue with that one as its goals are managed by Maven’s default lifecycle, which depends on the pom packaging. However for failsafe the goals are declared in spring-boot-starter-parent’s <pluginManagement> so it applies for all packaging types.
For the moment, I did it with a profile based on this question, but I find this quite dirty:
<profile>
<id>disable-integration-tests-for-pom-packaging</id>
<!-- this profile detects that we are not building an artifact, so we shouldn’t run failsafe -->
<activation>
<file>
<!-- can’t rely on ${project.*} for profile activation -->
<missing>${basedir}/src</missing>
</file>
</activation>
<properties>
<skipITs>true</skipITs>
</properties>
</profile>
Full poms
Parent:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!-- if changed, update spring-boot.version too! -->
<version>2.6.6</version>
<relativePath />
</parent>
<groupId>org.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
mvn verify output:
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< org.example:parent >-------------------------
[INFO] Building parent 1.0-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) # parent ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.619 s
[INFO] Finished at: 2022-04-14T14:07:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.2:integration-test (default) on project parent: No tests to run! -> [Help 1]
microservice pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
<!-- just to be able to build since I can’t actually install the parent -->
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>microservice</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Build should succeed as long as there are integration tests (and of course all of them are succeeding).
If you want a plugin to not run in the parent, but run in the child, you can add something along the following in the <plugins> section of your parent POM:
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<inherited>false</inherited>
<phase>none</phase>
</execution>
</executions>
</plugin>
This is for the maven source plugin, but you can adapt it for the failsafe plugin as well.

Starting Tomcat 8 with Cargo in background

I'm trying to run a web application using Cargo and Tomcat 8 (installed mode). I would start Tomcat as a background process with maven (by default, cargo:run blocks the console, waiting for a Ctrl+C), so I set cargo.process.spawn property to true, but I get the following output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building webapp-launcher 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.6.2:run (default-cli) # webapp-launcher ---
[INFO] [en2.ContainerRunMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.6.2 for container tomcat8x
[INFO] [talledLocalContainer] Tomcat 8.x starting...
[INFO] [stalledLocalDeployer] Deploying [/home/tomcat/.m2/repository/<<****removed****>>/<<****removed****>>.war] to [/home/tomcat/<<****removed****>>/target/cargo/configurations/tomcat8x/webapps]...
[INFO] [talledLocalContainer] Tomcat 8.x started on port [8080]
[INFO] [talledLocalContainer] spawn does not allow attributes related to input, output, error, result
[INFO] [talledLocalContainer] spawn also does not allow timeout
[INFO] [talledLocalContainer] finally, spawn is not compatible with a nested I/O <redirector>
[INFO] Press Ctrl-C to stop the container...
I tried to set timeout to 0, but nothing changed.
This is the pom.xml I'm using to deploy the webapp:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dummy.test</groupId>
<artifactId>webapp-launcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<repositories>
<repository>
<id>nexus-snapshots-1</id>
<name>Snaphots</name>
<url>***********************removed***********************</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-releases-1</id>
<name>Releases</name>
<url>***********************removed***********************</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<version>***********************removed***********************</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.2</version>
<configuration>
<container>
<timeout>0</timeout>
<containerId>tomcat8x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.12</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
<properties>
<cargo.process.spawn>true</cargo.process.spawn>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</build>
</project>
EDIT:
I think it's a bug, since the org.codehaus.cargo.container.spi.jvm.DefaultJvmLauncherFactory class sets a lot of hardcoded parameters that are not compatible with spawn mode (see this line).
It should be fixed in Cargo version 1.6.3.

Maven - copy all the dependencies of a project and and transitive dependencies

I’m new to maven. (I have searched for hours for the answer but without luck. mvn dependency:copy-dependencies do not solve my problem)
I need to copy all the dependencies of a project (in the form of jars) and if one of my jars depend on another artifact copy that artifact as well.
Example project1 pom.xml:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>project1</groupId>
<artifactId> project1.utils</artifactId>
<version>1.0</version>
<name> project1. utils </name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>project2</groupId>
<artifactId>project2.artifact</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>true</index>
<manifestEntries>
<Build-Number>${buildNumber}</Build-Number>
<Revision>${Revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
“project1” have a dependency of project2.artifact.jar. When I use “mvn dependency:copy-dependencies”, I get project2.artifact.jar but I do not get project3.artifact.jar that is a dependency of “project2”.
I do not have the pom of project2, but it is installed in my local repository.
How can I get all the dependencies of project 1 including the second jar (“project3.artifact.jar”)?
Pom of project2 would look something like this, but I don't have it when I go to a client. So I install project2.artifact.jar, project3.artifact.jar manually using "mvn install".
Project2 pom.xml:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>project2</groupId>
<artifactId>project2.artifact</artifactId>
<version>2.0</version>
<name>project2.artifact</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>project3</groupId>
<artifactId>project3.artifact</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>true</index>
<manifestEntries>
<Build-Number>${buildNumber}</Build-Number>
<Revision>${Revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Please use the latest version of dependency plugin:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies
If not works please check:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:list
copy-dependency goal copies the same artifacts which is resolved and displayed by tree and list goals.
For testing I prepare project3 pom.xml:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>project3</groupId>
<artifactId>project3.artifact</artifactId>
<version>3.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
I have such directory structure:
pr1
pom.xml - from question
pr2
pom.xml - from question
pr3
pom.xml - as shown above
Now I do:
cd pr3
mvn clean innstall
cd ../pr2
mvn clean innstall
mvn dependency:tree
dependency:tree output:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # project2.artifact ---
[INFO] project2:project2.artifact:jar:2.0
[INFO] \- project3:project3.artifact:jar:3.0:compile
So project2 depends on project3
next:
cd ../pr1
mvn clean install
mvn dependency:tree
dependency:tree in project1 output:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # project1.utils ---
[INFO] project1:project1.utils:jar:1.0
[INFO] \- project2:project2.artifact:jar:2.0:compile
[INFO] \- project3:project3.artifact:jar:3.0:compile
So it is also ok.
And now copy:
mvn dependency:copy-dependencies
With result:
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default-cli) # project1.utils ---
[INFO] Copying project3.artifact-3.0.jar to ...\pr1\target\dependency\project3.artifact-3.0.jar
[INFO] Copying project2.artifact-2.0.jar to ...\pr1\target\dependency\project2.artifact-2.0.jar
If you also want to copy project1 artifact add it to dependency in project1 pom.xml
...
<dependencies>
<dependency>
<groupId>project2</groupId>
<artifactId>project2.artifact</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>project1</groupId>
<artifactId>project1.utils</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
...
Now:
mvn clean dependency:copy-dependencies we have:
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default-cli) # project1.utils ---
[INFO] Copying project3.artifact-3.0.jar to ...\pr1\target\dependency\project3.artifact-3.0.jar
[INFO] Copying project2.artifact-2.0.jar to ...\pr1\target\dependency\project2.artifact-2.0.jar
[INFO] Copying project1.utils-1.0.jar to ...\pr1\target\dependency\project1.utils-1.0.jar

multi module maven release

i have a multi module maven project
the structure of the poms is workspace/parent , workspace/child1 ,workspace/child2
and in the svn repository i have one repository for all of them
when release:prepare executes , does not any problem, but when release:perform executes this error occurs
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.3.2:perform
(default-cli) on project veterans: Error executing Maven. Working
directory
"D:\java\myeclipse-workspace\veterans\target\checkout\veterans" does
not exist! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-release-plugin:2.3.2:perform
(default-cli) on project veterans: Error executing Maven.
i think the problem is the checkout from repository, because after checkout in the target folder we have trunk,tags,branches, but i think we must have parent,child1,child2
and other problem is, why when maven-release tags the snapshot, it tags the repository structure into svn repository tags?
after release:prepare we have trunk,branches,tags in svnrepository/tags/parent-1.0.0
this is my parent pom :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dpj</groupId>
<artifactId>veterans</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
<connection>scm:svn:http://192.168.1.10:7075/svn/veterans/trunk</connection>
<developerConnection>scm:svn:http://192.168.1.10:7075/svn/veterans/trunk</developerConnection>
<url>http://192.168.1.10:7075/svn/veterans</url>
</scm>
<properties>
<jdk.version>1.7</jdk.version>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<packname>-${project.version}-FL-${maven.build.timestamp}</packname>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>../veterans-presentation</module>
<module>../veterans-service</module>
</modules>
<distributionManagement>
<repository>
<id>dpj-artifactory-releases</id>
<name>dpj-artifactory-releases</name>
<url>http://192.168.1.10:8082/artifactory/ext-release-local</url>
</repository>
<snapshotRepository>
<id>dpj-artifactory-snapshots</id>
<name>dpj-artifactory-snapshots</name>
<url>http://192.168.1.10:8082/artifactory/ext-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<tagBase>http://192.168.1.10:7075/svn/veterans/tags/</tagBase>
<tagNameFormat>#{project.artifactId}-#{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>
</project>
i solved my issue by adding the project name in end of connection and developerConnection. as though
when the plugin wants to add to tag, it sets the checkout to parent folder. So i added the address of repository of projects with the name of folder after trunk.
<connection>scm:svn:http://reposotpry:7075/svn/veterans/trunk/veterans/</connection>
<developerConnection>scm:svn:http://reposotpry:7075/svn/veterans/trunk/veterans/</developerConnection>
and its fixed.

Maven 3 Multi Module build tries to run targets on the Multi Module POM itself

I have several projects that all have a similar Maven build. Each of the project POMs extend from a parent POM containing all of the common dependencies, plugins, etc. that are available to each project. I also have a multi-module POM, currently separate from the parent POM. The purpose of this multi-module POM is to have a single place I can run a target on all of the modules with one command.
If I try to run a plugin, say JS Duck, off of the multi-module POM, I get the following output (project names changed for simplicity):
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Project 1 .......................................... SUCCESS [7.850s]
[INFO] Project 2 .......................................... SUCCESS [0.803s]
[INFO] Project 3 .......................................... SUCCESS [8.488s]
[INFO] Multi-Module POM ................................... FAILURE [0.477s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.780s
[INFO] Finished at: Fri Dec 14 09:31:52 EST 2012
[INFO] Final Memory: 17M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jsduck' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories
It fails because I don't have the JS Duck plugin specified in my multi-module POM.
Why is it trying to run the plugin on the multi-module POM at all?
I can go the other route and include the modules in my parent POM instead of having a separate multi-module POM, but that has a different problem. In that case, the build succeeds because this time the JS Duck plugin is declared in the multi-module/parent POM. However, it runs the JS Duck plugin against the multi-module/parent POM which essentially generates a garbage 'target' directory because there is no code there to analyze.
For reference, my project structure is:
dev
|- Project1
|- pom.xml
|- Project2
|- pom.xml
|- Project3
|- pom.xml
|- pom.xml (parent POM)
|- all-pom.xml (multi-module POM)
Is there any recommended suggestions in this situation? Is there any way to stop Maven from trying to build the multi-module POM itself? Maybe a different <packaging> type that would do that?
Thanks for your suggestions!
[EDIT]
Here is the all-pom.xml... some details changed for privacy.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nate</groupId>
<artifactId>projects-all</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>Multi-Module POM</name>
<description>Builds all projects</description>
<modules>
<module>Project1</module>
<module>Project2</module>
<module>Project3</module>
</modules>
<repositories>
...
</repositories>
<pluginRepositories>
...
</pluginRepositories>
</project>
And here is the parent POM... including the addition of child modules.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nate.pom</groupId>
<artifactId>js-master</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>JavaScript Project POM</name>
<description>Parent POM for all JavaScript projects.</description>
<!-- inherit license and other company-wide configuration -->
<parent>
<groupId>com.nate</groupId>
<artifactId>master</artifactId>
<version>1.1</version>
</parent>
<modules>
<module>Project1</module>
<module>Project2</module>
<module>Project3</module>
</modules>
<properties>
<release.version>1.0.0</release.version>
</properties>
<scm>
...
</scm>
<issueManagement>
...
</issueManagement>
<ciManagement>
...
</ciManagement>
<developers>
...
</developers>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src/main/js</sourceDirectory>
</build>
<profiles>
<profile>
<id>javascript</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
...
</properties>
<dependencies>
...
</dependencies>
<build>
<plugins>
...
<plugin>
<groupId>nl.secondfloor.mojo.jsduck</groupId>
<artifactId>jsduck-maven-plugin</artifactId>
<version>0.1.1-SNAPSHOT</version>
<configuration>
<javascriptDirectory>src/main/js</javascriptDirectory>
<targetDirectory>target/site/api</targetDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
...
</repositories>
<pluginRepositories>
...
</pluginRepositories>
</project>
You can explicitly deactivate the plugin in the all-pom
<plugin>
<groupId>nl.secondfloor.mojo.jsduck</groupId>
<artifactId>jsduck-maven-plugin</artifactId>
<version>0.1.1-SNAPSHOT</version>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
The pom which contains the modules list:
<modules>
<module>..</module>
..
</modules>
must have the packaging type pom.

Resources