maven cargo tomcat7 远程部署

<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>com.sample</groupId>
<artifactId>demo2</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>demo2 Maven Webapp</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.6</java.version>
        <tomcat.url>http://localhost:8080</tomcat.url>
        <tomcat.username>tomcat</tomcat.username>
        <tomcat.password>abcd@1234</tomcat.password>
</properties>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
</dependencies>


<build>
<directory>${basedir}/target</directory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.8</version>
<configuration>
<!-- Container configuration -->
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<!-- Configuration to use with the container -->
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>${tomcat.url}/manager/text</cargo.remote.uri>
<cargo.remote.username>${tomcat.username}</cargo.remote.username>
<cargo.remote.password>${tomcat.password}</cargo.remote.password>
</properties>
</configuration>
</configuration>
                <!-- execution mvn clean install -->
                <executions>
                    <execution>
                        <id>redeploy-war-file-to-tomcat</id>
                        <phase>install</phase>
                        <goals>
                            <goal>redeploy</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>
</plugins>
</build>


</project>

展开阅读全文

使用MavenCargo插件远程部署JBOSS的问题

11-13

我想使用Maven的Cargo插件,把WEB应用远程部署到JBOSS下,部署代码:rn[code="java"]rnrn org.codehaus.cargorn cargo-maven2-pluginrn 1.0rn rn rn jboss42xrn /home/jboss/jboss-4.2.0.GArn remotern rn rn runtimern rn httprn 192.168.0.91rn 8080rn defaultrn jbossrn jboss000rn rn -XX:PermSize=512m -XX:MaxPermSize=1024rn -XX:+UseConcMarkSweepGCrn -XX:+CMSPermGenSweepingEnabledrn -XX:+CMSClassUnloadingEnabledrn rn rn rn rn remotern rn rn $project.groupIdrn $artifactIdrn warrn http://192.168.10.91:8080/$artifactIdrn 300000rn rn /$artifactIdrn rn rn rn rn rnrn[/code]rnrn但总报错:rn[code="java"]rnorg.codehaus.cargo.container.ContainerException: Failed to deploy to [http://192.168.0.91:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0=file:F%3A%5Cworkspace%5Cmyapp%5Ctarget%5Cmyapp.war]rn at org.codehaus.cargo.container.jboss.internal.JdkHttpURLConnection.connect(JdkHttpURLConnection.java:58)rn at org.codehaus.cargo.container.jboss.JBossRemoteDeployer.invokeURL(JBossRemoteDeployer.java:179)rn at org.codehaus.cargo.container.jboss.JBossRemoteDeployer.deploy(JBossRemoteDeployer.java:136)rn at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.deploy(AbstractDeployer.java:58)rn at org.codehaus.cargo.maven2.DeployerDeployMojo.performDeployerActionOnSingleDeployable(DeployerDeployMojo.java:75)rn at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:104)rn at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:47)rn at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:255)rn at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)rn at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)rn at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)rn at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)rn at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)rn at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)rn at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)rn at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)rn at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)rn at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)rn at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)rn at org.codehaus.classworlds.Launcher.main(Launcher.java:31)rnCaused by: java.io.FileNotFoundException: http://192.168.0.91:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0=file:F%3A%5Cworkspace%5Cmyapp%5Ctarget%5Cmyapp.warrn at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1303)rn at org.codehaus.cargo.container.jboss.internal.JdkHttpURLConnection.connect(JdkHttpURLConnection.java:51)rn ... 29 morernjava.io.FileNotFoundException: http://192.168.0.91:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0=file:F%3A%5Cworkspace%5Cmyapp%5Ctarget%5Cmyapp.warrn at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1303)rn at org.codehaus.cargo.container.jboss.internal.JdkHttpURLConnection.connect(JdkHttpURLConnection.java:51)rn at org.codehaus.cargo.container.jboss.JBossRemoteDeployer.invokeURL(JBossRemoteDeployer.java:179)rn at org.codehaus.cargo.container.jboss.JBossRemoteDeployer.deploy(JBossRemoteDeployer.java:136)rn at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.deploy(AbstractDeployer.java:58)rn at org.codehaus.cargo.maven2.DeployerDeployMojo.performDeployerActionOnSingleDeployable(DeployerDeployMojo.java:75)rn at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:104)rn at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:47)rn at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:255)rn at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)rn at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)rn at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)rn at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)rn at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)rn at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)rn at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)rn at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)rn at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)rn at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)rn at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)rn at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)rn at org.codehaus.classworlds.Launcher.main(Launcher.java:31)rn[/code]rnrn请精通Maven的朋友们看看。 问答

没有更多推荐了,返回首页