maven-ear-plugin ist auch nicht jarModule in application.xml

Ich habe nach dem Beispiel der maven-ear-plugin-Website, die zeigt, wie das hinzufügen von Drittanbieter-Bibliotheken, um die erzeugte application.xml. Jedoch, es scheint nicht zu funktionieren wie ich es erwartet habe. Ähnlich wie das web-Modul contextRoot ignoriert wird.

Entsprechend der Dokumentation was ich versuche zu tun, sollte durchaus möglich sein.

Die context-root des Web-Moduls kann individuell angepasst werden mit dem
contextRoot parameter.

Bitte beachten Sie, dass Bibliotheken von Drittanbietern (D. H. JarModule) nicht
enthalten in der generierten application.xml (nur ejb-client sein soll
in einer java-Eintrag). Allerdings eine jar-Abhängigkeit aufgenommen werden könnte
in der generierten application.xml durch die Angabe der
includeInApplicationXml Flagge
.

Habe ich die folgende Ausgabe, wenn es ausgeführt wird das bauen in meinem application.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
    "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">
<application>
  <display-name>MyApp.EAR</display-name>
  <module>
    <ejb>MyApp.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>MyApp.war</web-uri>
      <context-root>/MyApp.Web</context-root>
    </web>
  </module>
</application>

Aus der folgenden maven configuration - (pom.xml).

...
<modelVersion>4.0.0</modelVersion>
<groupId>com.blah</groupId>
<artifactId>MyApp.EAR</artifactId>
<version>1.0</version>
<packaging>ear</packaging>

<build>
    <plugins>
        <plugin>
            <groupId>maven-ear-plugin</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <applicationName>MyApp</applicationName>
                <modules>
                    <ejbModule>
                        <groupId>com.blah</groupId>
                        <artifactId>MyApp.EJB</artifactId>
                    </ejbModule>
                    <webModule>
                        <groupId>com.blah</groupId>
                        <artifactId>MyApp.Web</artifactId>
                        <contextRoot>MyApp</contextRoot>
                    </webModule>
                    <jarModule>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-simple</artifactId>
                        <includeLibInApplicationXml>true</includeLibInApplicationXml>
                    </jarModule>
                </modules>
                <archive>
                    <manifestEntries>
                        <WebLogic-Application-Version>${weblogic.version}</WebLogic-Application-Version>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <!-- web and ejb modules -->
    <dependency>
        <groupId>com.blah</groupId>
        <artifactId>MyApp.EJB</artifactId>
        <version>1.0</version>
        <type>ejb</type>
    </dependency>
    <dependency>
        <groupId>com.blah</groupId>
        <artifactId>MyApp.Web</artifactId>
        <version>1.0</version>
        <type>war</type>
    </dependency>
</dependencies>
...

Es ist sofort offensichtlich, dass die application.xml wird nicht generiert, als ich beabsichtigte.

  1. Der contextRoot geliefert wird, ist nicht korrekt in der application.xml anstelle der default-Namen MyApp.Web-Ausgabe statt der angegebenen Anwendung.
  2. Die org.slf4j jarModule angegeben ist, fehlt vollständig aus dem application.xml.

Was mache ich falsch?

Debuggen von Maven ist unten dargestellt.

[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <description>${project.description}</description>
  <displayName>${project.artifactId}</displayName>
  <encoding default-value="UTF-8"/>
  <generatedDescriptorLocation>${project.build.directory}</generatedDescriptorLocation>
  <includeLibInApplicationXml default-value="false"/>
  <project>${project}</project>
  <version default-value="1.3"/>
  <workDirectory>${project.build.directory}/${project.build.finalName}</workDirectory>
</configuration>

P. S. ich habe versucht, erstellen von maven-ear-plugin-tag, aber es würde nicht lassen Sie mich wie ich bin nicht seriös genug! Wenn das jemand erstellen könnte wäre ich dankbar.

  • Es scheint völlig ignoriert meine Konfiguration völlig. Irgendwelche Ideen, warum??
InformationsquelleAutor mrswadge | 2012-08-23
Schreibe einen Kommentar