Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
3.0.4
-
None
-
None
Description
I'm working on a multi-module build and a custom plugin in that build should contribute custom lifecycle and packaging type. Everything works as expected only if I install the plugin in advance and fails resolve the build extension despite the fact that it's a module that is a part of the project. If the custom plugin is not specified as extension then everything works as expected. Here is simple test that showcases the issue:
/pom.xml
-------------------------------------------------------------------
<?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/maven-v4_0_0.xsd">
<groupId>com.foo</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>extension</module>
<module>consumer</module>
</modules>
</project>
/extension/pom.xml
-------------------------------------------------------------------
<?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/maven-v4_0_0.xsd">
<groupId>com.foo</groupId>
<artifactId>extension</artifactId>
<version>1.0.0</version>
<packaging>maven-plugin</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.foo</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
</parent>
</project>
/consumer/pom.xml
-------------------------------------------------------------------
<?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/maven-v4_0_0.xsd">
<groupId>com.foo</groupId>
<artifactId>consumer</artifactId>
<version>1.0.0</version>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.foo</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>com.foo</groupId>
<artifactId>extension</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
The above project produces the following error:
[ERROR] Unresolveable build extension: Plugin com.foo:extension:1.0.0 or one of its dependencies could not be resolved: Failure to find com.foo:extension:jar:1.0.0 in...
Is this behavior expected? Is there a workaround?