2015-01-16 25 views
0

還有jar文件。一個是dependencyName.jar,另一個是dependencyName-runtime.jar我試圖使用maven-dependency-plugin來複制jar的運行時版本,但它一直在複製jar的常規版本。在〜/ .m2/path/to/jarfiles中指定具有maven的特定jar文件

 <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>${maven.dependency.version}</version> 
      <executions> 
       <execution> 
        <id>copy</id> 
        <phase>package</phase> 
        <goals> 
         <goal>copy</goal> 
        </goals> 
        <configuration> 
         <artifactItems> 
          <artifactItem> 
           <groupId>org.jacoco</groupId> 
           <artifactId>org.jacoco.agent</artifactId> 
           <version>${code.coverage.jacoco.version}</version> 
           <type>jar</type> 
           <overWrite>false</overWrite> 
          </artifactItem> 
         </artifactItems> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

回答

1

假設runtime是一個分類,你應該添加

<classifier>runtime</classifier> 

artifactItem

相關問題