JBoss Modules - Manifest module information

介绍

上一章介绍了在定义模块时,模块描述文件是怎样的结构以及有哪些选项。这一张将讨论打包成jar的应用如何申明对其它模块的依赖关系。

 

例如,如果你有一个用jar打包的应用并且想使用JBoss Modules来运行它。在这种情况下,我们需要有一种方式来告诉JBoss Modules 我们的应用依赖哪些模块,以便那些模块中的classes和resources能够被我们的应用所使用。要做到这一点,可以使用一个 manifest 文件。

 

在Manifest定义依赖

manifest依赖用来定义一个jar的依赖关系。下面是一个例子:

 

Dependencies: org.some.module, org.another.module

 

你也可以指定 version slot,跟在模块名字的后面:

 

Dependencies: org.some.module:main, org.another.module:1.0

将依赖配置到POM

下面是一个怎样将依赖关系配置到Maven pom.xml 的例子:

<plugins>
   <plugin>
      <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
      <version>2.3.1</version>
      <configuration>
         <archive>
            <manifestEntries>
               <Dependencies>org.some.module, org.another.module</Dependencies>
            </manifestEntries>
         </archive>
     </configuration>
   </plugin>
</plugins>
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值