2017-03-03 73 views
0

我有以下兩束:第谷包括捆綁成另一個

 
Master: 
    - lib/ 
    - META-INT/MANIFEST.MF 
    - plugin.xml 
    - build.properties 

Dependency: 
    - src/some_package/ 
    - META-INT/MANIFEST.MF 
    - build.properties 

而且我想使用Maven-第谷到最終使用以下罐結構:

 
Master.jar: 
    - lib/Dependency.jar: 
    - some_package/ 
    - META-INT/MANIFEST.MF 
    - build.properties 
    - META-INF/MANIFEST.MF 
    - plugin.xml 
    - build.properties 

任何想法我怎麼能做到這一點?我想我將不得不使用匯編插件,但我正在努力與Maven部分...

Thx!

編輯:我目前這個pom.xml的試穿主

<?xml version="1.0" encoding="UTF-8"?> 
<!-- Copyright (C) 2011, EclipseSource and others All rights reserved. This 
    program and the accompanying materials are made available under the terms 
    of the Eclipse Public License v1.0 which accompanies this distribution, and 
    is available at http://www.eclipse.org/legal/epl-v10.html --> 

<project 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 

    <parent> 
     <groupId>group</groupId> 
     <artifactId>plugins</artifactId> 
     <version>0.0.0</version> 
    </parent> 

    <artifactId>Master</artifactId> 
    <packaging>eclipse-plugin</packaging> 
    <version>0.0.0</version> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>${maven-dependency-version}</version> 
       <executions> 
        <execution> 
         <id>copy-dependency</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>copy</goal> 
         </goals> 
         <configuration> 
          <artifactItems> 
           <item> 
            <groupId>${project.groupId}</groupId> 
            <artifactId>Dependency</artifactId> 
            <version>${project.version}</version> 
           </item> 
          </artifactItems> 
          <outputDirectory>lib</outputDirectory> 
          <stripVersion>true</stripVersion> 
          <overWriteReleases>true</overWriteReleases> 
          <overWriteSnapshots>true</overWriteSnapshots> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

</project> 
+0

您可以顯示您當前的pom嗎?除了彙編插件,你可能會看到maven樹蔭插件 – Adonis

+0

@asettouf我已經使用當前POM更新了我的文章,但這些文章並不符合我的期望。我會看看這個插件thx! – Jerome

+0

問題是在這裏,依賴插件不包括jar中的依賴關係。你要麼需要程序集插件,要麼可能是陰影插件 – Adonis

回答

0

適用於以下POM只有「依賴」被納入「大師」的META-INF/MANIFEST.MF 。

注意編譯階段。

<?xml version="1.0" encoding="UTF-8"?> 
<!-- Copyright (C) 2011, EclipseSource and others All rights reserved. This 
    program and the accompanying materials are made available under the terms 
    of the Eclipse Public License v1.0 which accompanies this distribution, and 
    is available at http://www.eclipse.org/legal/epl-v10.html --> 

<project 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 

    <parent> 
     <groupId>group</groupId> 
     <artifactId>plugins</artifactId> 
     <version>0.0.0</version> 
    </parent> 

    <artifactId>Master</artifactId> 
    <packaging>eclipse-plugin</packaging> 
    <version>0.0.0</version> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>${maven-dependency-version}</version> 
       <executions> 
        <execution> 
         <id>copy-dependency</id> 
         <phase>compile</phase> 
         <goals> 
          <goal>copy</goal> 
         </goals> 
         <configuration> 
          <artifactItems> 
           <item> 
            <groupId>${project.groupId}</groupId> 
            <artifactId>Dependency</artifactId> 
            <version>${project.version}</version> 
           </item> 
          </artifactItems> 
          <outputDirectory>lib</outputDirectory> 
          <stripVersion>true</stripVersion> 
          <overWriteReleases>true</overWriteReleases> 
          <overWriteSnapshots>true</overWriteSnapshots> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

</project>