多个mudle的工程创建

(利用maven创建spring-osgi powered 多bundle工程 )

1、创建顶层的mvn工程的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>
<name>Centrepoint</name>
<groupId>com.effectivemaven.centrepoint</groupId>
<artifactId>centrepoint</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<description>
Centrepoint is a basic but useful application that sets up a
dashboard of project information from Maven, Archiva and
Continuum.
</description>
</project>

2 假设我们要创建的工程包括3个模块   module-one,module-two,module-three
依次执行下面的语句
mvn archetype:generate -DartifactId=module-one -DgroupId=com.maventest.parent
mvn archetype:generate -DartifactId=module-two -DgroupId=com.maventest.parent
mvn archetype:generate -DartifactId=module-three -DgroupId=com.maventest.parent

3 执行完成之后 mvn eclipse:eclipse 导入工程就会得到3个工程

4 查看主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>
<name>parent</name>
<groupId>com.maventest.parent</groupId>
<artifactId>projectMain</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<description>
This is main parent project.
</description>
<modules>
<module>module-one</module>
<module>module-two</module>
<module>module-three</module>
<module>module-web</module>
</modules>
</project>

5 增加本地repository
<repositories>
<repository>
<id>holly-thinkpad-releases</id>
<name>holly-thinkpad-releases</name>
<url>http://localhost:8081/artifactory/repo</url>
</repository>
</repositories>


6 增加dependencies
<dependencies>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.maven.artifact.version}</version>
</dependency>
</dependencies>

7 增加resource 文件路径
<build>
<resources>
<!-- standard Maven folder -->
<resource>
<directory>src/main/resources</directory>
</resource>
<!-- plus root folder -->
<resource>
<directory>.</directory>
<includes>
<include>plugin.xml</include>
<include>META-INF/*</include>
</includes>
</resource>
</resources>
</build>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值