Aliaksei
Aliaksei

Reputation: 1457

Wildfly-Maven-Plugin only Ear and War

My project structure such

-parent
--web
--server
----moduleA
----moduleB
----moduleС
----main

My parent pom.xml

            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>${wildfly-maven-plugin.version}</version>
                <configuration>
                    <hostname>${wildfly-hostname}</hostname>
                    <port>${wildfly-port}</port>
                    <username>${wildfly-username}</username>
                    <password>${wildfly-password}</password>
<!--                    <filename>${project.build.directory}/${project.build.finalName}.${project.packaging}</filename> ??     -->
                </configuration>
            </plugin>

I want deploy only WAR fro mweb module and EAR from main module But now deploy all jar etc

How I must configure my maven?

Upvotes: 3

Views: 1984

Answers (2)

James R. Perkins
James R. Perkins

Reputation: 17780

There is a <skip>true</skip> configuration option you could use as well. By default have it set to true then in the modules you want deployed change it to false.

On the parent pom use the following:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>${wildfly-maven-plugin.version}</version>
    <configuration>
        <skip>true</skip>
        <hostname>${wildfly-hostname}</hostname>
        <port>${wildfly-port}</port>
        <username>${wildfly-username}</username>
        <password>${wildfly-password}</password>
    </configuration>
</plugin>

Then on the in the pom's for the modules you want deployed use:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <configuration>
        <skip>false</skip>
    </configuration>
</plugin>

Upvotes: 8

Aliaksei
Aliaksei

Reputation: 1457

mvn wildfly:undeploy
mvn -pl :by.mobile.main wildfly:deploy "-P moduleA, web" -DskipTests
mvn -pl :admin.mobile.ui wildfly:deploy "-P moduleA, web" -DskipTests

Upvotes: 0

Related Questions