jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-4178

Plugin dependency not always included to classpath

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.1.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    mvn 2.1.0
  • Complexity:
    Intermediate

Description

Plugins not always see their dependencies.

For example. I got project with parent project -

  • if I run mvn install on child project mvn package runs correctly.
  • if i run mvn install on parent project then child project is build with error, plugin doesn't see their dependency and fails with class not found

Example of child project
Short example

<?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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>oss</groupId>
<artifactId>oss</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>oss</groupId>
<artifactId>oss-ws</artifactId>
<packaging>war</packaging>
(...)
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>oss-rpc</artifactId>
<version>${version}</version>
<scope>provided</scope> <!-- if dependecy is compile evething runs ok-->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<id>wsdl_generate_service_classes</id>
<phase>process-classes</phase>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<genWsdl>true</genWsdl>
<sei>oss.ossServiceImpl</sei>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>oss-rpc</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</plugin>
(...)

Parent project

(..)
<modules>
<module>oss</module>
</modules>

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-1323 Plugin extensions (dependencies) not resolved in reactor build

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Benjamin Bentmann added a comment - 28/May/09 2:06 PM

I believe that's a dup of MNG-1323. As a workaround, you could add a <pluginManagement> section in the parent POM that defines the plugin dependencies such that these are used for all modules in a reactor build.

Show
Benjamin Bentmann added a comment - 28/May/09 2:06 PM I believe that's a dup of MNG-1323. As a workaround, you could add a <pluginManagement> section in the parent POM that defines the plugin dependencies such that these are used for all modules in a reactor build.
Hide
Permalink
Krashan Brahmanjara added a comment - 29/May/09 2:49 AM

True but if childs projects use this plugin that all got the same dependency from parent. This may results with this error

The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='...'}' and 'Vertex{label='...'}' introduces to cycle in the graph (...) --> (...) --> (...) [INFO]

I don't see method to exclude this dependency. For example I try assign dependency in parent only to specified goal

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<goals>
<goal>wsgen</goal>
</goals>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>oss-services-ejb</artifactId>
<version>${version}</version>
<classifier>client</classifier>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>

Show
Krashan Brahmanjara added a comment - 29/May/09 2:49 AM True but if childs projects use this plugin that all got the same dependency from parent. This may results with this error The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='...'}' and 'Vertex{label='...'}' introduces to cycle in the graph (...) --> (...) --> (...) [INFO] I don't see method to exclude this dependency. For example I try assign dependency in parent only to specified goal <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxws-maven-plugin</artifactId> <goals> <goal>wsgen</goal> </goals> <dependencies> <dependency> <groupId>${groupId}</groupId> <artifactId>oss-services-ejb</artifactId> <version>${version}</version> <classifier>client</classifier> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build>
Hide
Permalink
Benjamin Bentmann added a comment - 29/May/09 3:10 AM

OK, if you can't add the dependency in the parent's plugin management section, the other option you can try is to add the plugin dependency to the first module that uses the plugin when you do a reactor build from the parent. The first use of the plugin will create its class realm.

Show
Benjamin Bentmann added a comment - 29/May/09 3:10 AM OK, if you can't add the dependency in the parent's plugin management section, the other option you can try is to add the plugin dependency to the first module that uses the plugin when you do a reactor build from the parent. The first use of the plugin will create its class realm.

People

  • Assignee:
    Benjamin Bentmann
    Reporter:
    Krashan Brahmanjara
Vote (0)
Watch (0)

Dates

  • Created:
    28/May/09 5:59 AM
    Updated:
    29/Mar/10 6:11 AM
    Resolved:
    29/Mar/10 6:11 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.