« Return to Thread: transitive cargo dependencies

Re: transitive cargo dependencies

by Alexander Brill :: Rate this Message:

Reply to Author | View in Thread



On Wed, May 27, 2009 at 5:49 PM, Martin West <martin@...> wrote:
its my experience that maven2 configures a plugin on first encounter. I had similar problems using the antrun plugin with different subprojects requiring different ant deps. I had to put the antrun plugin config in the root projects pom with all the deps. I was getting different behaviours depending on whether I invoked mvn in the root or the subproject. This is on 2.0.8,  2.0.9 and 2.0.10. I vaguely recall someone raising an issue on this.

come back maven1 all is forgiven :-)

Martin West


On 27 May 2009, at 15:21, Matt Wringe wrote:

On Tue, 2009-05-26 at 12:28 +0200, Alexander Brill wrote:
Hi,

I have a parent pom where I have defined my cargo plugin configuration
for Maven2 which several of our projects use.

However, one of our projects have an extra dependency which I don't
want included into the other projects. So I'd like to append this
extra dependency to the projects pom.

But trying to reconfigure the plugin overwrites all the other
dependencies, so I only get mygroup:myartifact included, all other are
removed. Is there a way to accomplish what I want?

Can any maven experts help out here?


    <plugin>
      <groupId>org.codehaus.cargo</groupId>
      <artifactId>cargo-maven2-plugin</artifactId>
      <configuration>
        <container>
          <dependencies>
              <dependency>
                  <artifactId>myartifact</artifactId>
                  <groupId>mygroup</groupId>
              </dependency>
          </dependencies>
      </container>
      </configuration>
    </plugin>



Yeah, I ended up concluding with that this would be difficult, or even impossible, with Maven2. Any new plugin redefining I do in my child pom overwrites the elements defined in the parent.

The only solution I could think of is to have if-else and include functions for maven. With an include function one could split the master pom up wherever you'd like.


--
Alexander Brill
http://brill.no

 « Return to Thread: transitive cargo dependencies