You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marcelo Alcantara <ma...@gmail.com> on 2008/02/25 20:45:59 UTC

Cargo does not work when using profiles in the pom.xml (profile IS active).

Hi,

I am trying to use cargo based on the pom.xml profile configuration.

When executing "mvn cargo:start" it says it cannot find the plugin with this
prefix (cargo).

When I use mvn help:active-profiles it shows me the "jboss" profile is
active.

If I copy the <build> xml block from the profile to the pom (without the
profile) and runs "mvn cargo:start" it works fine.

I tried a lot of ideas here but could not make this work.

Somebody can give me any hint on this one?

Follows my profile configuration bellow.

Thanks in advance.

Marcelo Alcantara

<profile>

<id>jboss</id>

<activation>

<activeByDefault>true</activeByDefault>

</activation>

<build>

<pluginManagement>

<plugins>

<plugin>

<groupId>org.codehaus.cargo</groupId>

<artifactId>cargo-maven2-plugin</artifactId>

<version>0.3.1</version>

<executions>

<execution>

<id>start-container</id>

<phase>install</phase>

<goals>

<goal>start</goal>

</goals>

</execution>

</executions>

<configuration>

<container>

<containerId>jboss4x</containerId>

<zipUrlInstaller>

<url>S:/software/jboss/hg_jboss-4.0.5.GA_v2.zip</url>

<installDir>C:/software</installDir>

</zipUrlInstaller>

</container>

<configuration>

<home>${project.build.directory}/jboss/server</home>

</configuration>

</configuration>

</plugin>

</plugins>

</pluginManagement>

</build>

</profile>


-- 
Marcelo Alcantara
Senior Developer/Architect
--------------------------------------------------------
maralc@gmail.com
+55 11 81968823

Re: Cargo does not work when using profiles in the pom.xml (profile IS active).

Posted by Marcelo Alcantara <ma...@gmail.com>.
Anybody?

Thanks in advance!

Marcelo

On Mon, Feb 25, 2008 at 4:45 PM, Marcelo Alcantara <ma...@gmail.com> wrote:

> Hi,
>
> I am trying to use cargo based on the pom.xml profile configuration.
>
> When executing "mvn cargo:start" it says it cannot find the plugin with
> this prefix (cargo).
>
> When I use mvn help:active-profiles it shows me the "jboss" profile is
> active.
>
> If I copy the <build> xml block from the profile to the pom (without the
> profile) and runs "mvn cargo:start" it works fine.
>
> I tried a lot of ideas here but could not make this work.
>
> Somebody can give me any hint on this one?
>
> Follows my profile configuration bellow.
>
> Thanks in advance.
>
> Marcelo Alcantara
>
> <profile>
>
> <id>jboss</id>
>
> <activation>
>
> <activeByDefault>true</activeByDefault>
>
> </activation>
>
> <build>
>
> <pluginManagement>
>
> <plugins>
>
> <plugin>
>
> <groupId>org.codehaus.cargo</groupId>
>
> <artifactId>cargo-maven2-plugin</artifactId>
>
> <version>0.3.1</version>
>
> <executions>
>
> <execution>
>
> <id>start-container</id>
>
> <phase>install</phase>
>
> <goals>
>
> <goal>start</goal>
>
> </goals>
>
> </execution>
>
> </executions>
>
> <configuration>
>
> <container>
>
> <containerId>jboss4x</containerId>
>
> <zipUrlInstaller>
>
> <url>S:/software/jboss/hg_jboss-4.0.5.GA_v2.zip</url>
>
> <installDir>C:/software</installDir>
>
> </zipUrlInstaller>
>
> </container>
>
> <configuration>
>
> <home>${project.build.directory}/jboss/server</home>
>
> </configuration>
>
> </configuration>
>
> </plugin>
>
> </plugins>
>
> </pluginManagement>
>
> </build>
>
> </profile>
>
> --
> Marcelo Alcantara
> Senior Developer/Architect
> --------------------------------------------------------
> maralc@gmail.com
> +55 11 81968823
>



-- 
Marcelo Alcantara
Senior Developer/Architect
--------------------------------------------------------
maralc@gmail.com
+55 11 81968823

Re: Cargo does not work when using profiles in the pom.xml (profile IS active).

Posted by Marcelo Alcantara <ma...@gmail.com>.
Hi Stefan,

Thanks for your attention.

After you mentioned the pluginManagement, I decided to look at this
tag/config, and found out that it was the problem.

>From the POM reference, I could notice that what is below pluginManagement
does not work by itself. And that you shoud also define the same plugin
inside the plugins section from the build. Then, my result parent pom
contains the profiles with the plugin management specifying the behaviour of
cargo with jboss. And inside the build/plugins section, there is a simple:


<plugin>

<groupId>org.codehaus.cargo</groupId>

<artifactId>cargo-maven2-plugin</artifactId>

</plugin>

...activating the pluginManagement one.

The child projects inherits from this one. And from the ear I can execute
mvn package deploy cargo:start and it works.

If this sounds bad design I would like to hear your advice. I am using a
multimodule flat structure with eclipse.

Thanks again,

Marcelo

On Tue, Feb 26, 2008 at 9:26 AM, VUB Stefan Seidel <ss...@vub.de> wrote:

> Hi,
>
> why do you use pluginManagement within a profile? Also, you can always
> define the plugin outside the profile in pluginManagement without the
> executions and within the profile with the executions.
> Have you tried "mvn cargo:start -Pjboss" anyway?
>
> Stefan
>
> Marcelo Alcantara wrote:
> > Hi,
> >
> > I am trying to use cargo based on the pom.xml profile configuration.
> >
> > When executing "mvn cargo:start" it says it cannot find the plugin with
> this
> > prefix (cargo).
> >
> > When I use mvn help:active-profiles it shows me the "jboss" profile is
> > active.
> >
> > If I copy the <build> xml block from the profile to the pom (without the
> > profile) and runs "mvn cargo:start" it works fine.
> >
> > I tried a lot of ideas here but could not make this work.
> >
> > Somebody can give me any hint on this one?
> >
> > Follows my profile configuration bellow.
> >
> > Thanks in advance.
> >
> > Marcelo Alcantara
> >
> > <profile>
> >
> > <id>jboss</id>
> >
> > <activation>
> >
> > <activeByDefault>true</activeByDefault>
> >
> > </activation>
> >
> > <build>
> >
> > <pluginManagement>
> >
> > <plugins>
> >
> > <plugin>
> >
> > <groupId>org.codehaus.cargo</groupId>
> >
> > <artifactId>cargo-maven2-plugin</artifactId>
> >
> > <version>0.3.1</version>
> >
> > <executions>
> >
> > <execution>
> >
> > <id>start-container</id>
> >
> > <phase>install</phase>
> >
> > <goals>
> >
> > <goal>start</goal>
> >
> > </goals>
> >
> > </execution>
> >
> > </executions>
> >
> > <configuration>
> >
> > <container>
> >
> > <containerId>jboss4x</containerId>
> >
> > <zipUrlInstaller>
> >
> > <url>S:/software/jboss/hg_jboss-4.0.5.GA_v2.zip</url>
> >
> > <installDir>C:/software</installDir>
> >
> > </zipUrlInstaller>
> >
> > </container>
> >
> > <configuration>
> >
> > <home>${project.build.directory}/jboss/server</home>
> >
> > </configuration>
> >
> > </configuration>
> >
> > </plugin>
> >
> > </plugins>
> >
> > </pluginManagement>
> >
> > </build>
> >
> > </profile>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Marcelo Alcantara
Senior Developer/Architect
--------------------------------------------------------
maralc@gmail.com
+55 11 81968823

Re: Cargo does not work when using profiles in the pom.xml (profile IS active).

Posted by VUB Stefan Seidel <ss...@vub.de>.
Hi,

why do you use pluginManagement within a profile? Also, you can always 
define the plugin outside the profile in pluginManagement without the 
executions and within the profile with the executions.
Have you tried "mvn cargo:start -Pjboss" anyway?

Stefan

Marcelo Alcantara wrote:
> Hi,
> 
> I am trying to use cargo based on the pom.xml profile configuration.
> 
> When executing "mvn cargo:start" it says it cannot find the plugin with this
> prefix (cargo).
> 
> When I use mvn help:active-profiles it shows me the "jboss" profile is
> active.
> 
> If I copy the <build> xml block from the profile to the pom (without the
> profile) and runs "mvn cargo:start" it works fine.
> 
> I tried a lot of ideas here but could not make this work.
> 
> Somebody can give me any hint on this one?
> 
> Follows my profile configuration bellow.
> 
> Thanks in advance.
> 
> Marcelo Alcantara
> 
> <profile>
> 
> <id>jboss</id>
> 
> <activation>
> 
> <activeByDefault>true</activeByDefault>
> 
> </activation>
> 
> <build>
> 
> <pluginManagement>
> 
> <plugins>
> 
> <plugin>
> 
> <groupId>org.codehaus.cargo</groupId>
> 
> <artifactId>cargo-maven2-plugin</artifactId>
> 
> <version>0.3.1</version>
> 
> <executions>
> 
> <execution>
> 
> <id>start-container</id>
> 
> <phase>install</phase>
> 
> <goals>
> 
> <goal>start</goal>
> 
> </goals>
> 
> </execution>
> 
> </executions>
> 
> <configuration>
> 
> <container>
> 
> <containerId>jboss4x</containerId>
> 
> <zipUrlInstaller>
> 
> <url>S:/software/jboss/hg_jboss-4.0.5.GA_v2.zip</url>
> 
> <installDir>C:/software</installDir>
> 
> </zipUrlInstaller>
> 
> </container>
> 
> <configuration>
> 
> <home>${project.build.directory}/jboss/server</home>
> 
> </configuration>
> 
> </configuration>
> 
> </plugin>
> 
> </plugins>
> 
> </pluginManagement>
> 
> </build>
> 
> </profile>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org