第谷包括另一个包

时间:2017-03-03 16:52:18

标签: java maven tycho

我有以下两个包:

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

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

我想使用Maven-tycho结束以下jar结构:

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在Master

上尝试
<?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>

1 个答案:

答案 0 :(得分:0)

仅当&#34;依赖&#34;时才使用以下POM。被包含在&#34; Master&#34;的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>