Intellij IDEA-Artefakt 'XXXX: Krieg explodiert' hat eine ungültige Erweiterung

Jedes mal, wenn ich selbst die kleinste Veränderung meiner POM Intellij entfernt .Krieg-Erweiterung für meine explodierte Artefakt in der Projekt-Struktur-Ausgabe-Verzeichnis festlegen. Dies verursacht einen Fehler in Intellij ' s Run/Debug-Konfiguration:

Artefakt "XXXX:Krieg explodierte' hat eine ungültige Erweiterung.

Um das Problem zu beheben muss ich manuell überschreiben Sie die Projekt-Struktur output-Verzeichnis einrichten. Jedes mal, wenn ich auch die kleinste änderung der POM-ich muss zurück, um die Ausgabe-Verzeichnis festlegen und manuell Anhängen ".Krieg" bis zum Ende der Ausgabe-Verzeichnis festlegen. Dies ist inzwischen sehr alt und frustrierend.

z.B. muss ich das ändern:

E:\workarea\enterp\application\target\application

:

E:\workarea\enterp\application\target\application.war

Wenn ich manuell die Maven-KRIEG-plugin outputDirectory Konfiguration wie folgt, bedeutet dies nicht hilft:

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>${maven.war.plugin.version}</version>
    <configuration>

        <!-- Output directory of artifact:war exploded keeps losing the .war extension -->
        <outputDirectory>${project.build.directory}.war</outputDirectory>

    </configuration>
</plugin>

Wie kann ich dieses problem beheben?

EDIT:

Hier ist der komplette build-config:

    <build>
    <!-- Maven will append the version to the finalName (which is the name
        given to the generated war, and hence the context root) -->
    <finalName>${project.artifactId}</finalName>

    <plugins>
        <!-- Compiler plugin enforces Java 1.6 compatibility and activates annotation
            processors -->
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>${maven.war.plugin.version}</version>
            <configuration>
                <!-- Output directory of artifact:war exploded keeps losing the .war extension -->
                <outputDirectory>${project.build.directory}/${project.artifactId}.war</outputDirectory>

                <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! -->
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <!-- The WildFly plugin deploys your war to a local WildFly container -->
        <!-- To use, run: mvn package wildfly:deploy -->
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>${version.wildfly.maven.plugin}</version>
        </plugin>
    </plugins>

</build>

ZWEITER EDIT:

Entdeckte ich, dass eine Lösung ist, fügen Sie ".Krieg" ${project.artifactId} in der build-Konfiguration, z.B.:

<finalName>${project.artifactId}.war</finalName>

entfernen und outputDirectory aus der plugin-Konfiguration. Also die build-config sollte so Aussehen:

<build>
    <!--
        Maven will make finalName the name of the generated war.

        NOTE:   Output directory of artifact:war exploded keeps losing the .war extension
                http://youtrack.jetbrains.com/issue/IDEA-86484
                http://youtrack.jetbrains.com/issue/IDEA-95162

                The solution is to append ".war" to ${project.artifactId}, below:
    -->
    <finalName>${project.artifactId}.war</finalName>

    <plugins>
        <!-- Compiler plugin enforces Java 1.6 compatibility and activates annotation
            processors -->
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>${maven.war.plugin.version}</version>
            <configuration>
                <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! -->
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <!-- The WildFly plugin deploys your war to a local WildFly container -->
        <!-- To use, run: mvn package wildfly:deploy -->
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>${version.wildfly.maven.plugin}</version>
        </plugin>
    </plugins>

</build>

HAFTUNGSAUSSCHLUSS: Wenn Sie diese Problemumgehung verwenden nur bewusst sein, dass beim bereitstellen eines explodierten KRIEG Artefakt der name der Datei wird unter dem Namen XXXX.Krieg.Krieg. Es funktioniert-ich bereitgestellt das Artefakt als war-Datei in Intellij-aber es ist hässlich.

INFO [org.jboss.als.server.deployment] (MSC service thread 1-7) JBAS015876: Ab dem Einsatz von "XXXX.Krieg.Krieg" (runtime-name: "XXXX.Krieg.Krieg)"

Wenn mir jemand sagen kann, wie konfigurieren Sie die Intellij-Projekt für die Arbeit mit Maven zu wählen, der eine oder andere finalName Werte, je nachdem, ob ich eine war-Datei implementiert vs. explodierte Artefakt dann diese Frage wird hinreichend beantwortet.

<!-- Exploded artifact --> 
<finalName>${project.artifactId}.war</finalName>

<!-- WAR file (unexploded) artifact --> 
<finalName>${project.artifactId}</finalName>

InformationsquelleAutor der Frage Patrick Garner | 2014-07-13

Schreibe einen Kommentar