Konfigurieren von Maven-shade-plugin in einem multi-Modul-Projekt?

jeder! Ich habe versucht, Sie zu erhalten, Glas mit Maven-Shade-Plugin, aber ich verstehe immer noch nicht zum Erfolg 🙁

Das ist meine Projekt-Struktur:

MainModule
  -Module1
    -src
    -pom.xml
  -Module2
    -src
    -pom.xml
  -pom.xml

Modul1 (pom.xml):

<parent>
    <artifactId>MainModule</artifactId>
    <groupId>com.plugintest</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Module1</artifactId>

Modul2 (pom.xml):

<parent>
    <artifactId>MainModule</artifactId>
    <groupId>com.plugintest</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Module1</artifactId>

MainModule (pom.xml):

<groupId>com.plugintest</groupId>
<artifactId>MainModule</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
    <module>Module1</module>
    <module>Module2</module>
</modules>
<build>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.2</version>
        <executions>
            <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            </execution>
        </executions>
        </plugin>
    </plugins>
</build>

Laut diesem code bekomme ich 2 jar-Dateien (Module1-version.jar und Module2-version.jar). Aber es ist nicht das, was ich will. Ich wünschte, man 1 jar-Datei (MainModule-version.jar), die enthalten würde, die andere (Modul1 und Modul2).

Bitte, sagen Sie mir, warum nicht das Shade Plugin zu arbeiten?

  • Ihre "Modul2" mit der Bezeichnung "Modul 1" in die code-snippets oben. ...
InformationsquelleAutor nightin_gale | 2014-01-09
Schreibe einen Kommentar