cargo maven plugin 部署tomcat7, 兼容 tomcat8
插件来源于下面网站
http://cargo.codehaus.org/Maven2+plugin
Pom.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>com.mkyong.common</groupId> <artifactId>SpringMVC</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>SpringMVC Maven Webapp</name> <url>http://maven.apache.org</url> <repositories> <repository> <id>JBoss repository</id> <url>http://repository.jboss.org/nexus/content/groups/public/</url> </repository> </repositories> <properties> <spring.version>3.0.5.RELEASE</spring.version> </properties> <dependencies> <!-- Spring 3 dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependency> </dependencies> <build> <finalName>SpringMVC</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <!-- 指定插件名称及版本号 --> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.4.8</version> <configuration> <wait>true</wait> <!--是否说明,操作start、stop等后续操作必须等前面操作完成才能继续--> <container> <!-- 容器的配置 --> <containerId>tomcat7x</containerId> <!-- 指定tomcat版本 --> <type>installed</type> <!-- 指定类型:standalone, installed等 --> <home>D:\software\apache-tomcat-7.0.57</home> <!-- 指定Tomcat的位置,即catalina.home --> </container> <configuration> <!-- 具体的配置 --> <type>existing</type> <!-- 类型,existing:存在 --> <home>D:\software\apache-tomcat-7.0.57</home> <!-- Tomcat的位置,即catalina.home --> </configuration> <deployables> <!-- 部署设置 --> <deployable> <!-- 部署的War包名等 --> <groupId>com.mkyong.common</groupId> <artifactId>SpringMVC</artifactId> <type>war</type> <properties> <context>ROOT</context> <!-- 部署路径 --> </properties> </deployable> </deployables> <deployer> <!-- 部署配置 --> <type>installed</type> <!-- 类型 --> </deployer> </configuration> <executions> <!-- 执行的动作 --> <execution> <id>verify-deployer</id> <phase>install</phase> <!-- 解析install --> <goals> <goal>deployer-deploy</goal> </goals> </execution> <execution> <id>clean-deployer</id> <phase>clean</phase> <goals> <goal>deployer-undeploy</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
之后使用maven cargo:run 启动tomcat
如果想进行调试可以用下面这个配置
<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.mkyong.common</groupId> <artifactId>SpringMVC</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>SpringMVC Maven Webapp</name> <url>http://maven.apache.org</url> <repositories> <repository> <id>JBoss repository</id> <url>http://repository.jboss.org/nexus/content/groups/public/</url> </repository> </repositories> <properties> <spring.version>3.0.5.RELEASE</spring.version> <!-- if you want a remote debugging on a different a address override on command line with -Dcargo.debug.addres=xxxx --> <cargo.debug.address>8000</cargo.debug.address> <!-- if you want to start remote debugging session suspended override on command line with -Dcargo.debug.suspend=y --> <cargo.debug.suspend>n</cargo.debug.suspend> <!-- Cargo Tomcat container version used for Tomcat tarball distribution url --> <cargo.tomcat.major.version>7</cargo.tomcat.major.version> <cargo.args/> </properties> <dependencies> <!-- Spring 3 dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependency> </dependencies> <build> <finalName>SpringMVC</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <!-- 指定插件名称及版本号 --> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.4.8</version> <configuration> <wait>true</wait> <!--是否说明,操作start、stop等后续操作必须等前面操作完成才能继续--> <container> <!-- 容器的配置 --> <containerId>tomcat${cargo.tomcat.major.version}x</containerId> <!-- 指定tomcat版本 --> <type>installed</type> <!-- 指定类型:standalone, installed等 --> <home>D:\software\apache-tomcat-7.0.57</home> <!-- 指定Tomcat的位置,即catalina.home --> </container> <configuration> <properties> <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${cargo.args}]]></cargo.jvmargs> <cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable> <catalina.servlet.uriencoding>UTF-8</catalina.servlet.uriencoding> </properties> <type>standalone</type> <home>${project.build.directory}/tomcat${cargo.tomcat.major.version}x</home> </configuration> <deployables> <!-- 部署设置 --> <deployable> <!-- 部署的War包名等 --> <groupId>com.mkyong.common</groupId> <artifactId>SpringMVC</artifactId> <type>war</type> <properties> <context>ROOT</context> <!-- 部署路径 --> </properties> </deployable> </deployables> <deployer> <!-- 部署配置 --> <type>installed</type> <!-- 类型 --> </deployer> </configuration> <executions> <!-- 执行的动作 --> <execution> <id>verify-deployer</id> <phase>install</phase> <!-- 解析install --> <goals> <goal>deployer-deploy</goal> </goals> </execution> <execution> <id>clean-deployer</id> <phase>clean</phase> <goals> <goal>deployer-undeploy</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
停止tomcat 命令
cargo:stop -Dcargo.debug.address=9000
相关推荐
maven下使用Cargo实现自动化部署到tomcat7中cargo:deploy
NULL 博文链接:https://doujiang327.iteye.com/blog/1463726
NULL 博文链接:https://jdonee.iteye.com/blog/774387
使用cargo-maven2-plugin插件配置Tomcat本地自动发布 .
maven cargo插件远程部署web项目的简单案例,留作笔记,也分享给大家了!希望有所帮助
尚硅谷学习笔记+代码,Maven 教程 Maven 是 Apache 软件基金会组织维护的一款专门为 Java 项目提供构建和依赖管理支持的工具 ...部署 war 包:借助相关 Maven 插件(例如 cargo),将 war 包部署到 Tomcat 服务器上
gradle-cargo-plugin:Gradle插件,可通过Cargo为本地和远程容器提供部署功能
cargo实现自动化部署远程jetty容器(非安全模式)
采用maven工程依赖 多war部署 cargo使用多模块 cargo停止
cargo jetty-7-and-onwards-deployer-1.6.5,自动上传部署
具体介绍了maven初学搭建项目一个流程,内容详细,并且介绍主流maven插件比如cargo,checkstyle,findbugs以及在tomcat上项目的运行
使用Cargo Maven插件部署到Apache TomEE 部署到Apache TomEE 使用Arquillian和Weld容器进行测试 使用Arquillian和Glassfish v6进行测试 与Arquillian和Open Liberty进行测试 参考 雅加达EE 9里程碑发布聚会 ...
jsr107tck.zip,使用guice测试工具jsr107技术兼容性工具包运行注释测试
cargo子命令,用于构建,运行和部署rust wasm应用程序,如浏览器,electron或cordova应用程序。 特征 当前,您可以使用以下命令: 建立您的专案: cargo node build 运行您的项目: cargo node run 部署您的...
1.安装make: cargo install cargo-make 2.将压缩包释放到某个文件夹下,并进入该文件夹 3.启动一个命令窗口,使用cargo make build构建项目 4.使用cargo make serve启动项目 5.启动另外一个命令窗口,使用cargo make...
领域驱动设计cargo案例
cargo-outdated, 用于显示 Rust 依赖项什么时候过期的cargo子命令 货物过期 Linux: 用于显示 Rust 依赖项什么时候过期的cargo子命令cargo-outdated 用于显示依赖项是否有更新的版本。工作原理cargo-outdated的功能很...
兼容性该插件与 10.x及更高版本兼容。配置该插件CARGO_HOME可以在使用的CARGO_HOME和RUSTUP_HOME环境变量。 除了CARGO_HOME值以外,还可以使用PATH环境变量来在生成代理上找到防锈和货运工具。建造该项目使用gradle...
Cargo is the Rust package manager. Cargo downloads your Rust package’s dependencies,compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package ...
Tomcat 7/8独立部署是通过Cargo管理的。 这是Comsat Maven原型的端口,位于 。 入门 只需编辑gradle/user-props.gradle 。 您可能想要在gradle/user-props.gradle和gradle/user-props.gradle添加JVM参数和系统属性...