繁体   English   中英

基于Eclipse Target平台的Maven依赖-插件开发

[英]Maven dependency based on Eclipse Target Platform - Plug-in Development

在为eclipse 3.7.2开发插件时,我依赖于refactoring.jar,它将成为目标平台-插件开发的一部分。 如果目标平台更改,则jar的版本可能会更改。 由于该特定版本在maven中央存储库或我们的任何内部存储库中均不可用,因此我将jar复制到project / lib目录,并在pom.xml中使用以下依赖于systemPath的方式进行了定义。

<dependency>
        <groupId>org.eclipse.ltk.core</groupId>
        <artifactId>refactoring</artifactId>
        <version>3.5.201-r372_v20111101-0700</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/refactoring-3.5.201-r372_v20111101-0700.jar</systemPath>
    </dependency> 

它可以编译项目并在目标平台上成功运行。 但我想使依赖项独立于版本/目标平台。 意味着它应该始终选择目标平台版本。 感谢对此的任何建议。

通过使用依赖性管理,可以在一处更改的情况下简化操作。

-----在paretn pom中--------

`<dependencyManagement>
   <dependency> 
     <groupId>org.eclipse.ltk.core</groupId> 
     <artifactId>refactoring</artifactId> 
     <version>3.5.201-r372</version> 
  </dependency>
</dependencyManagement>` 

------在个人pom文件中-----------

`<dependency> 
  <groupId>org.eclipse.ltk.core</groupId> 
   <artifactId>refactoring</artifactId> 
    <scope>provided</scope> 
 </dependency>`

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM