使用eclipse搭建maven多module项目(构建父子项目java子项目和web子项目)

本文详细介绍了如何使用Eclipse创建Maven多模块项目,包括创建父项目、Java子项目和Web子项目,并解决搭建过程中遇到的问题,如错误"The superclass 'javax.servlet.http.HttpServlet' was not found on the Java Build Path",Dynamic Web Module版本升级到2.5的步骤,以及设置部署程序集。最后,文章提到了子项目间的依赖配置,以实现Java子项目调用Web子项目的功能。
摘要由CSDN通过智能技术生成

1、创建空的Maven项目

File–>new–>project–>Maven Project...

2、next


3、finish

4、配置pom

<?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.nancy</groupId>
  <artifactId>DemoParent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
	<modules>
		<module>DemoParent-Son1</module>
		<module>DemoParentSon2</module>
	</modules>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<junit.version>4.11</junit.version>
		<spring.version>4.0.0.RELEASE</spring.version>
	</properties>
	<build>
		<finalName>DemoParent</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<compilerVersion>1.6</compilerVersion>
				</configuration>
			</plugin>
			<!-- jar插件 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true&
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值