一个完整版本的paren child

里面包含了 parent 和 child 两个包,然后parent 还包含了一个 framework的包,manage 段的内容是规定了 后面dependence里面依赖的版本号, 对parent 和child都有效,
child里面的

easy-parent.pom

<modelVersion>4.0.0</modelVersion> [b][color=red]现在maven版本都是强制用4.0.0的[/color][/b]

<groupId>com.xiangsoft.easy</groupId>
<artifactId>easy-parent</artifactId>
<version>1.0.1</version> [b][color=red]这里表示parent 是版本1.0.1[/color][/b]
<packaging>pom</packaging>
<name>easy-parent</name>

<modules>
<module>easy-inbound</module> [b][color=red]这里表示child有一个 easy-inbound的模块[/color][/b]

</modules>


easy-inbound.pom
<modelVersion>4.0.0</modelVersion>
<groupId>com.xiangsoft.easy</groupId>
<artifactId>easy-inbound</artifactId>
<version>2.1.1</version>[b][color=red]这是child 模块的版本,在install的时候会放到自己的库中, 版本呈现是2.1.1, 而他所依赖的会在下面<parent> 块中指定[/color][/b]

<packaging>jar</packaging>

<name>easy-inbound</name>

<parent>
<groupId>com.xiangsoft.easy</groupId>
<artifactId>easy-parent</artifactId>
<version>1.0.1</version> >[b][color=red]child 模块所依赖的parent 版本是 1.0.1[/color][/b]

</parent>

[color=darkred][b]注意里面还有能打包source code的plugin , 并且这个打包方式是只干净的打包自己的那块代码 , 不象其他的打包会一股脑 打入所有的class 到一个jar , 如
[/b][/color]
[quote]

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>wang.manager.BuildTool</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

[/quote]


[color=darkblue][b]在eclipse中 , 如果引用了 本地库中没有的jar包 , 但是 eclipse已经定义过的 指定的maven 版本的项目, 那 也可以maven编译通过, 并且 他会拿eclipse中的 项目 进行项目关联 代码关联,而如果是 本地库有的 代码 和 版本 , 则会直接用 库中的代码 [/b][/color]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值