Eclipse + Maven + Jetty 开发WebApp
2013-01-09 12:24
246 查看
作为一句java开发人员,
(以配置一个Spring+Hibernate+Struts2的WebApp为例)
你是否为到处网站找jar包以及相关依赖而烦闷不已,
你是否为它们之间jar包版本不兼容或冲突而怒发冲冠,
你是否为你电脑上的jar包存放位置而晕头转向,
你是否为你多个项目之间jar包的共享重用而头疼不已,
你是否为你的项目构建war包写一大串ant脚本而眼球充血,
还有 回归测试、持续集成、部署 等诸多问题...
程序员的时间应该用在写好程序上面,而不应该花太多在这些环节上。
maven是这些问题的终结者,而且它能做得更多。
maven会让你更喜欢java.
“自从搞上maven,眼不酸了,手不疼了,腰脚有力了...”
###################################################################
http://maven.apache.org/
http://www.eclipse.org/jetty/
http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin
http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
工具:Eclipse + Maven + Jetty
插件:m2eclipse, maven-jetty-plugin
mvn jetty:run -Djetty.port=2222
pom.xml
(以配置一个Spring+Hibernate+Struts2的WebApp为例)
你是否为到处网站找jar包以及相关依赖而烦闷不已,
你是否为它们之间jar包版本不兼容或冲突而怒发冲冠,
你是否为你电脑上的jar包存放位置而晕头转向,
你是否为你多个项目之间jar包的共享重用而头疼不已,
你是否为你的项目构建war包写一大串ant脚本而眼球充血,
还有 回归测试、持续集成、部署 等诸多问题...
程序员的时间应该用在写好程序上面,而不应该花太多在这些环节上。
maven是这些问题的终结者,而且它能做得更多。
maven会让你更喜欢java.
“自从搞上maven,眼不酸了,手不疼了,腰脚有力了...”
###################################################################
http://maven.apache.org/
http://www.eclipse.org/jetty/
http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin
http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
工具:Eclipse + Maven + Jetty
插件:m2eclipse, maven-jetty-plugin
mvn jetty:run -Djetty.port=2222
pom.xml
<?xml version="1.0" encoding="UTF-8"?> <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.cg</groupId> <artifactId>test-maven-jetty</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>test-maven-jetty Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- Optional: TODO 1 Pick the version of jetty you want. --> <jetty.version>8.1.8.v20121106</jetty.version> </properties> <!-- TODO 2 Configure repo2.maven.org as a repository. --> <!-- Optional <repositories> <repository> <id>repo2_maven_org</id> <url>http://repo2.maven.org/maven2</url> </repository> </repositories> --> <build> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <!--old version <artifactId>maven-jetty-plugin</artifactId> --> <!-- Optional --> <version>${jetty.version}</version> <configuration> <!-- 每n秒扫描项目的文件改动,包括java类文件;若为0,一改动保存则重启jetty --> <scanIntervalSeconds>10</scanIntervalSeconds> <stopPort>9999</stopPort> <webApp> <contextPath>/w</contextPath> </webApp> </configuration> </plugin> </plugins> </build> <!-- <build> <outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes</outputDirectory> <finalName>test-maven-tomcat</finalName> </build> --> <dependencies> <!-- <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <version>${jetty.version}</version> </dependency> --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> </project>
相关文章推荐
- Eclipse开发环境创建Servlet3.0 Maven WebApp 项目
- 使用Eclipse+Maven+Jetty构建Java Web开发环境(几个教程综合集成2014发行)
- Eclipse开发环境创建Servlet3.0 Maven WebApp 项目
- 在eclipse中使用jetty插件替代m2e开发调试maven web项目
- 天生一对"Maven2+Jetty" -- Maven2创建并管理WebApp,并使用Maven Jetty Plugin在Eclipse中调试
- 在Eclipse中开发Maven-web项目时报错:maven-archetype-webapp
- 天生一对"Maven2+Jetty" -- Maven2创建并管理WebApp,并使用Maven Jetty Plugin在Eclipse中调试
- Eclipse开发环境创建Servlet3.0 Maven WebApp 项目
- 工作笔记(二): eclipse maven-jetty组合开发
- eclipse集成jetty开发web项目(不采用maven方式)
- 在Eclipse中开发Maven-web项目时报错:maven-archetype-webapp
- 天生一对"Maven2+Jetty" -- Maven2创建并管理WebApp,并使用Maven Jetty Plugin在Eclipse中调试
- 用Eclipse+Maven+Jetty构建Java Web开发环境(综合几篇教程整合2014年版)
- java开发环境搭建,jdk,eclipse,git,gradle,ssh,tomcat,mysql,navicat mysql,maven,svn环境搭建
- Eclipse 开发利器 Jrebel热部署配置 基于Jetty
- eclipse中jetty启动maven项目,调试debug时,修改js文件必须关闭jetty才能保存
- Maven 环境快速搭建二(eclipse+maven2+jetty)
- maven的webapp项目热部署到eclipse,biz等子项目的jar包都找不到的解决方案!
- Eclipse下通过Maven的Jetty插件运行Web工程的配置
- 记录:eclipse+maven创建webapp项目