Ebuzer Taha KANAT
Ebuzer Taha KANAT

Reputation: 933

maven wildfly plugin deploy artifact with classifier

Maven WildFly plugin not deploying artifact with classifier.

    <profile>
        <id>development</id>
        <activation>
            <property>
                <name>env</name>
                <value>dev</value>
            </property>
        </activation>
        <properties>
            <project.stage>Development</project.stage>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                     <classifier>development</classifier>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <configuration>
                        <classifier>development</classifier>
                        <skip>false</skip>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

when running

$ mvn clean install wildfly:deploy -P development

maven plugin keep looking for artifact without classifier then complaining about not finding it. Same happens with deploy-artifact .

Upvotes: 0

Views: 392

Answers (1)

James R. Perkins
James R. Perkins

Reputation: 17780

The deploy does not have a classifier attribute. If you want to deploy your application with a different name you would need to override the filename parameter. Something like the following.

<profile>
    <id>development</id>
    <activation>
        <property>
            <name>env</name>
            <value>dev</value>
        </property>
    </activation>
    <properties>
        <project.stage>Development</project.stage>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                 <classifier>development</classifier>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <configuration>
                    <classifier>development</classifier>
                    <filename>${project.build.finalName}-development.war</filename>
                    <skip>false</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

However the deploy-artifact goal does have a classifier attribute. It was not added until 1.1.0.Alpha5 though so you'll need to be using at least that version preferably 1.1.0.Final.

Upvotes: 1

Related Questions