[jira] Created: (CARGO-725) Deploying tomcat application with cargo maven plugin /

View: New views
1 Messages — Rating Filter:   Alert me  

[jira] Created: (CARGO-725) Deploying tomcat application with cargo maven plugin /

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Deploying tomcat application with cargo maven plugin /
-------------------------------------------------------

                 Key: CARGO-725
                 URL: http://jira.codehaus.org/browse/CARGO-725
             Project: Cargo
          Issue Type: Bug
          Components: Build, Maven2, Tomcat
         Environment: Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0-beta2
Plugin-Version: org.codehaus.cargo:cargo-maven2-plugin:1.0-beta-2
            Reporter: KG


Hello,

I need to deploy a tomcat application (war) to the local instance of the tomcat (tomcat is running standalone - catalina.bat run).

The parent pom.xml refers both, the module "tomcat-webapp" (packaging war) and "tomcat-webapp-deployer" (packaging pom):
{code:xml}
<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>de.mypackage</groupId>
  <artifactId>my-root</artifactId>
  <packaging>pom</packaging>
  <name>My Root Application</name>
  <version>0.0.1-SNAPSHOT</version>
  <build>
  <plugins>
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                        <encoding>iso-8859-1</encoding>
                        <source>1.6</source>
                        <target>1.6</target>
                </configuration>
        </plugin>
  </plugins>
  </build>
  <modules>
  <module>tomcat-webapp</module>
  <module>tomcat-webapp-deployer</module>  
  </modules>
</project>
{code}

The pom.xml of the web application looks like this:

{code:xml}
<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>de.mypackage</groupId>
  <artifactId>tomcat-webapp</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>tomcat-webapp Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
        <dependency>
                <artifactId>servlet-api</artifactId>
                <groupId>javax.servlet</groupId>
                <version>2.5</version>
        </dependency>
        <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
        </dependency>
  </dependencies>  

  <build>  
        <finalName>my-first-tomcat-webapp</finalName>  
        <plugins>  
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                                <encoding>iso-8859-1</encoding>
                                <source>1.6</source>
                                <target>1.6</target>
                        </configuration>
                </plugin>    
        </plugins>    
  </build>  
 
 </project>
 {code}


The pom.xml of the deployer (packaging == pom) looks like this:

{code:xml}
<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>de.mypackage</groupId>
  <artifactId>tomcat-webapp-deployer</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>tomcat-webapp Deployer</name>
  <url>http://maven.apache.org</url>
  <dependencies>
  <dependency>
          <groupId>de.mypackage</groupId>
          <artifactId>tomcat-webapp</artifactId>
          <version>1.0-SNAPSHOT</version>
          <type>war</type>
  </dependency>
  </dependencies>
  <build>
  <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.0-beta-2</version>
                    <configuration>
                        <wait>true</wait>
                        <container>
                            <containerId>tomcat6x</containerId>
                            <type>installed</type>
                            <home>${catalina.home}</home>
                        </container>
                        <configuration>
                            <type>existing</type>
                            <home>${catalina.home}</home>                    
                        </configuration>
                        <deployer>
                            <type>installed</type>
                            <deployables>
                                <deployable>
                                    <groupId>de.mypackage</groupId>
                                    <artifactId>tomcat-webapp</artifactId>
                                    <type>war</type>
                                </deployable>
                            </deployables>
                        </deployer>
                    </configuration>
                    <executions>
                        <!--
                                Maven has the concept of a 'phase' which can be thought of a
                                collection of goals. Hence here we are specifying that during the
                                'install' phase first deploy the webapp to the container specific
                                folder and then start the container. Both 'deployer-deploy' and
                                'start' are cargo specific goals.
                        -->
                        <execution>
                                <id>verify-deploy</id>
                                <phase>install</phase>
                                <goals>
                                        <goal>deployer-deploy</goal>
                                        <goal>start</goal>
                                </goals>
                        </execution>
                        <!--
                                Specifying that during the 'pre-clean' phase, Cargo should first
                                stop the container.
                        -->
                        <execution>
                                <id>clean-undeploy</id>
                                <phase>pre-clean</phase>
                                <goals>
                                        <goal>stop</goal>
                                </goals>
                        </execution>
                    </executions>
                </plugin>      
</plugins>    
</build>  
 
</project>
{code}

Now, I perform the command "mvn install" in the root directory (artifact "my-root"). This exception is thrown:

{noformat}
[DEBUG] Configuring mojo 'org.codehaus.cargo:cargo-maven2-plugin:1.0-beta-2:deployer-deploy' -->
[DEBUG]   (f) type = existing
[DEBUG]   (f) configuration = org.codehaus.cargo.maven2.configuration.Configuration@114e777
[DEBUG]   (s) containerId = tomcat6x
[DEBUG]   (f) type = installed
[DEBUG]   (f) container = org.codehaus.cargo.maven2.configuration.Container@112b853
[DEBUG]   (s) type = installed
[DEBUG]   (s) groupId = de.mypackage
[DEBUG]   (s) artifactId = tomcat-webapp
[DEBUG]   (s) type = war
[DEBUG]   (f) deployables = [org.codehaus.cargo.maven2.configuration.Deployable@1670cc6]
[DEBUG]   (f) deployer = org.codehaus.cargo.maven2.configuration.Deployer@77b794
[DEBUG]   (f) localRepository = Repository[local|file://C:\Dokumente und Einstellungen\kg\.m2\repository]
[DEBUG]   (f) project = MavenProject: de.mypackage-tomcat-webapp-deployer:1.0-SNAPSHOT @ C:\....
[DEBUG]   (f) repositories = [Repository[central|http://10.1.2.108:8081/archiva/repository/myrepo]]
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@e86f41
[DEBUG] -- end configuration --
[INFO] [cargo:deployer-deploy {execution: verify-deploy}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create configuration for the parameters (container [id = [tomcat6x], type = [installed]], configuration type [existing]).
The configuration home parameter must be specified for existing configurations
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.codehaus.cargo.container.ContainerException: Failed to create configuration for the parameters (container [id = [tomcat6x], type = [inst
alled]], configuration type [existing]).
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:157)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFacto
ry.java:86)
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:375)
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:362)
        at org.codehaus.cargo.maven2.configuration.Configuration.createConfiguration(Configuration.java:152)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createConfiguration(AbstractCargoMojo.java:315)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:469)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:409)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:44)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:266)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:589)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.codehaus.cargo.container.ContainerException: The configuration home parameter must be specified for existing configurations
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createInstance(DefaultConfigurationFactory.java:438)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:153)
        ... 28 more
org.codehaus.cargo.container.ContainerException: The configuration home parameter must be specified for existing configurations
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createInstance(DefaultConfigurationFactory.java:438)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:153)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFacto
ry.java:86)
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:375)
        at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:362)
        at org.codehaus.cargo.maven2.configuration.Configuration.createConfiguration(Configuration.java:152)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createConfiguration(AbstractCargoMojo.java:315)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:469)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:409)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:44)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:266)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:589)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
{noformat}

Thank you for support
kati

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email