<?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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.lrlz</groupId> <artifactId>lrlz-platform</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <repositories> <repository> <id>nexus-releases</id> <name>Local Nexus Repository</name> <url>http://oa.lrlz.com:8081/nexus/content/repositories/releases</url> </repository> <repository> <id>thirdparty</id> <name>Local Nexus Repository</name> <url>http://********/nexus/content/repositories/thirdparty</url> </repository> </repositories> <distributionManagement> <repository> <id>nexus-releases</id> <name>Local Nexus Repository</name> <url>http://********/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Local Nexus Repository</name> <url>http://********/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> <!-- 设置 Spring 的版本信息--> <properties> <jdk.version>1.7</jdk.version> <org.springframework.version>4.0.0.RELEASE</org.springframework.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <!-- Core utilities used by other modules. Define this if you use Spring Utility APIs (org.springframework.core.*/org.springframework.util.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${org.springframework.version}</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <!-- Expression Language (depends on spring-core) Define this if you use Spring Expression APIs (org.springframework.expression.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Bean Factory and JavaBeans utilities (depends on spring-core) Define this if you use Spring Bean APIs (org.springframework.beans.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Aspect Oriented Programming (AOP) Framework (depends on spring-core, spring-beans) Define this if you use Spring AOP APIs (org.springframework.aop.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Application Context (depends on spring-core, spring-expression, spring-aop, spring-beans) This is the central artifact for Spring's Dependency Injection Container and is generally always defined --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Various Application Context utilities, including EhCache, JavaMail, Quartz, and Freemarker integration Define this if you need any of these integrations --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Transaction Management Abstraction (depends on spring-core, spring-beans, spring-aop, spring-context) Define this if you use Spring Transactions or DAO Exception Hierarchy (org.springframework.transaction.*/org.springframework.dao.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- JDBC Data Access Library (depends on spring-core, spring-beans, spring-context, spring-tx) Define this if you use Spring's JdbcTemplate API (org.springframework.jdbc.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-Relation-Mapping (ORM) integration with Hibernate, JPA, and iBatis. (depends on spring-core, spring-beans, spring-context, spring-tx) Define this if you need ORM (org.springframework.orm.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Object-to-XML Mapping (OXM) abstraction and integration with JAXB, JiBX, Castor, XStream, and XML Beans. (depends on spring-core, spring-beans, spring-context) Define this if you need OXM (org.springframework.oxm.*) <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${org.springframework.version}</version> </dependency> --> <!-- Web application development utilities applicable to both Servlet and Portlet Environments (depends on spring-core, spring-beans, spring-context) Define this if you use Spring MVC, or wish to use Struts, JSF, or another web framework with Spring (org.springframework.web.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Servlet Environments (depends on spring-core, spring-beans, spring-context, spring-web) Define this if you use Spring MVC with a Servlet Container such as Apache Tomcat (org.springframework.web.servlet.*) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- Spring MVC for Portlet Environments (depends on spring-core, spring-beans, spring-context, spring-web) Define this if you use Spring MVC with a Portlet <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>${org.springframework.version}</version> </dependency> Container (org.springframework.web.portlet.*) --> <!-- Support for testing Spring applications with tools such as JUnit and TestNG This artifact is generally always defined with a 'test' scope for the integration testing framework and unit testing stubs --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${org.springframework.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.9</version> <scope>test</scope> </dependency> <!-- 上面的都是Spring的jar包,可以选择性的添加 --> <!-- Mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.1</version> </dependency> <!-- Mybatis 和Spring整合包,是mybatis出的 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.2.3</version> </dependency> <!-- oracle的数据库驱动 <dependency> <groupId>com.oracle</groupId> <artifactId>oracle14</artifactId> <version>10.2.0.4.0</version> </dependency> --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.34</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.15</version> </dependency> <!-- oro --> <dependency> <groupId>oro</groupId> <artifactId>oro</artifactId> <version>2.0.8</version> </dependency> <!-- 日志打印 log4j --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.5</version> </dependency> <!-- druid 是配置数据源的包 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.1.36</version> </dependency>--> <!-- Spring 文件上传的包 --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3</version> </dependency> <!-- Spring 文件上传的依赖包 --> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <!-- 基本工具Jar --> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.9.0</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.2</version> </dependency> <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> <version>1.10</version> </dependency> <!-- <dependency> <groupId>commons-dbutils</groupId> <artifactId>commons-dbutils</artifactId> <version>1.5</version> </dependency> --> <!-- dom4j 解析 XML文件的包 --> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1.4</version> </dependency> <!-- 下面的三个包是在配置事务的时候用到的 spring的依赖包 --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.7.4</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>15.0</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.3</version> </dependency> <!-- 下面的两个包是jedis的依赖包 --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> <version>1.0.2.RELEASE</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3.1</version> </dependency> <!-- ssh通信架包 <dependency> <groupId>com.googlecode.xmemcached</groupId> <artifactId>xmemcached</artifactId> <version>1.3.5</version> </dependency> <dependency> <groupId>sshtools</groupId> <artifactId>j2ssh-core</artifactId> <version>0.2.2</version> </dependency>--> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>xstream</groupId> <artifactId>xstream</artifactId> <version>1.4.4</version> </dependency> <dependency> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> <version>1.4.01</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.3.1</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.2.1</version> </dependency> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.20</version> </dependency> <!-- netty <dependency> <groupId>org.jboss.netty</groupId> <artifactId>netty</artifactId> <version>3.2.5.Final</version> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.5.0</version> </dependency>--> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <!-- 处理json --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.0.0</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.5</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.5</version> </dependency> <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.0</version> </dependency> <!-- <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.3.16.3</version> </dependency> --> <!-- mongodb依赖包 <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>3.5.0</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-highlighter</artifactId> <version>3.5.0</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> <version>2.11.3</version> </dependency>--> <dependency> <groupId>fakepath</groupId> <artifactId>quartz-all</artifactId> <version>1.6.1</version> </dependency> <!-- jetty --> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api-2.5</artifactId> <version>6.1.14</version> <scope>provided</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>com/lrlz/**/sqlmap/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build> <!-- 聚合 --> <modules> <module>core</module> <module>system</module> <module>buyer</module> <module>webApp</module> </modules> </project>
以上是父工程的pom.xml文件,
在子工程中把jetty加入进来如下:
<build> <finalName>webApp</finalName> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.2.v20140723</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> </configuration> </plugin> </plugins> </build>
一定要注意jetty的版本问题,jdk是1.7以上,jetty对应的要选9以上,这个为问题困扰了我一天多
这样配置后本地环境既可以通过tomcat发布,也可以通过jetty来发布
jetty发布的命令:jetty:run -Djetty.port=8888
tomcat发布的命令:tomcat:run -Dmaven.tomcat.port=8080 -Dmaven.tomcat.path=/
相关推荐
在Java开发领域,Maven和Jetty是两个非常重要的工具。Maven是一个项目管理工具,它可以帮助开发者管理和构建Java项目,而Jetty则是一个轻量级的嵌入式Servlet容器,常用于快速开发、测试以及部署Web应用。本文将详细...
maven-tomcat-plugin让maven与tomcat配合得很好。它可以把应用部署到Tomcat服务器,也可以把tomcat作为内嵌服务器启动,就像jetty一样。 使用JPDA启动tomcat的远程调试功能。这样就能与eclipse配合起来,轻松地实现...
在本项目中,Maven 负责集成所有依赖,包括Spring MVC、Mybatis、Jetty和MySQL驱动等。 2. Spring MVC: Spring MVC 是Spring框架的一部分,它是一个基于模型-视图-控制器(Model-View-Controller)设计模式的Web...
IntelliJ IDEA配置tomcat和jetty详解 IntelliJ IDEA是一款功能强大且流行的集成开发环境(IDE),广泛应用于Java开发领域。今天,我们将讨论如何在IntelliJ IDEA中配置tomcat和jetty服务器,以便更好地开发和调试...
标题 "Netbeans Jetty Maven项目调试配置" 涉及的是在Java开发环境中,如何使用Netbeans IDE结合Jetty服务器和Maven构建工具进行项目的调试配置。这是一个关键的知识点,对于那些经常处理Web应用程序的开发者来说...
Cargo插件是一个Maven插件,可以用于自动化部署Web应用程序到各种Web容器中,如Tomcat、Jetty等。 **使用WebLogicMavenPlugin插件自动化部署weblogic** WebLogicMavenPlugin插件用于自动化部署Web应用程序到Oracle...
另外,maven-jetty-plugin和maven-tomcat-plugin可以直接在Maven命令行启动Jetty或Tomcat服务器,实现Web应用的快速部署和热更新。 6. **maven-tomcat-plugin**:这是一个用于将项目直接部署到Tomcat服务器的Maven...
- 创建一个新的Maven项目,并在pom.xml中添加DWR和Jetty的依赖。 - 配置DWR的`dwr.xml`文件,定义允许从客户端访问的服务器端方法。 - 编写Java服务端代码,包括Servlet或Spring MVC控制器,以及业务逻辑。 - 在Web...
你需要添加必要的依赖,包括Maven的Jetty插件和Servlet API。例如: ```xml <!-- Servlet API --> <groupId>javax.servlet <artifactId>javax.servlet-api <version>4.0.1 <scope>provided <!--...
在Spring Boot框架中,开发者可以选择不同的嵌入式Web服务器作为应用程序的容器,其中最常见的是Tomcat和Jetty。本文将深入探讨如何在Spring Boot项目中从Tomcat切换到Jetty容器,以及这两个容器的特点和使用场景。 ...
- **Jetty / Tomcat**: 作为应用服务器,运行和部署Java Web应用。 - **Log4j / SLF4J**: 日志记录框架,用于调试和跟踪应用行为。 - **Jackson / Gson**: JSON序列化和反序列化库,用于处理HTTP请求和响应中的...
与Tomcat等其他服务器相比,Jetty的体积小、启动速度快,且可以直接与Maven集成,方便开发者进行项目的构建和运行。本文将深入探讨如何使用Jetty和Maven来启动一个Web项目。 首先,我们需要在项目中引入Jetty的...
在这个项目中,`Maven`的配置文件`pom.xml`会定义项目依赖,如`Spring`和`Jetty`,以及构建过程。通过执行简单的命令,如`mvn clean install`,你可以构建、测试和打包整个项目。 `Spring`是一个开源的应用程序框架...
6. **Maven依赖管理**:Maven通过POM文件管理项目依赖,自动下载并解决依赖冲突,使得团队开发更加协调。 7. **Maven的 profiles**:可以根据不同的环境(如开发、测试、生产)设置不同的配置,如数据库连接信息,...
4. 配置Jetty插件,使得通过Maven命令可以启动和停止Jetty服务器。 5. 下载并安装JRebel,配置Eclipse以启用JRebel代理,实现热部署功能。 6. 如果有"stripes"相关文件,将其导入项目,根据需要理解和使用这个框架。...
- **Maven依赖管理(Dependency Management)**:Maven自动管理项目的依赖,包括解析依赖树、处理依赖冲突等功能。 - **站点生成和报告(Site Generation and Reporting)**:Maven可以通过`maven-site-plugin`插件自动...
Jetty JARS和依赖(Dependencies) 启动参数(Start Options) Jetty and JEE6 Web Profile 配置参考 Jetty XML语法(Syntax)–Jetty IOC Configuration Jetty XML用法–Using and Combining Jetty Configurations ...
6. 部署:完成开发和测试后,可以使用Maven的package目标生成一个可部署的war文件,然后将其上传到生产环境的Web服务器,如Tomcat或Jetty,进行正式部署。 总的来说,这个项目展示了如何使用Maven、Spring MVC和...
1. 使用Eclipse创建一个Maven项目,并在`pom.xml`中配置Spring MVC、Servlet和Jetty的相关依赖。 2. 编写Spring MVC的控制器类,使用注解来指定请求映射和依赖注入。 3. 创建服务层和数据访问层,同样利用注解进行...
Maven依赖管理的核心在于它的`pom.xml`文件,这是一个项目对象模型(Project Object Model)的配置文件,记录了项目的所有依赖。通过在`pom.xml`中声明依赖,Maven可以自动下载并管理这些依赖,避免了手动下载JAR...