2017-03-03 4 views
0

ich die folgenden zwei Bündel haben:Tycho umfassen bündeln in ein anderes

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

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

Und ich möchte mit der folgenden jar Struktur Ende-up mit Maven-tycho:

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

Jede Idee Wie könnte ich das tun? Ich denke, ich muss das Assembly-Plugin verwenden, aber ich habe Probleme mit dem Maven-Teil ...

Thx!

EDIT: Ich versuche zur Zeit mit diesem pom.xml auf Meister

<?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

Können Sie Ihren aktuellen Pom zeigen? Neben dem Assembly-Plugin könntest du auch in das maven shade plugin schauen: – Adonis

+0

@asettouf Ich habe meinen Beitrag mit dem aktuellen POM aktualisiert, der nicht das tut, was ich erwarte. Ich werde mir dieses Plugin anschauen, thx! – Jerome

+0

Das Problem besteht darin, dass das Abhängigkeits-Plugin keine Abhängigkeiten in jar enthält. Du brauchst entweder das Assembly-Plugin oder vielleicht das Schatten-Plugin – Adonis

Antwort

0

Arbeiten mit dem folgende POM nur dann, wenn "Abhängigkeit" in den META-INF/MANIFEST.MF von "Master" enthalten ist .

Beachten Sie die kompilieren Phase.

<?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>