lpacheco
lpacheco

Reputation: 1026

How do I specify a Wildfly server version when using wildfly-maven-plugin?

When I start my webapp using the wildfly-maven-plugin (mvn wildfly:run), it starts with Wildfly 10. I need to test it with Wilfly 8.1.

Is there some parameter for chosing the Wildfly server version?

This is the piece of pom.xml I used to enable wildfly:run:

<build>
    <plugins>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
        </plugin>
    </plugins>
</build>

Upvotes: 2

Views: 1730

Answers (1)

uthark
uthark

Reputation: 5363

There are several options:

  1. Configure user property in pom.xml:

    <properties>
        <wildfly.version>8.1.0.Final</wildfly.version>
    </properties>
    <build>
    <plugins>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
        </plugin>
    </plugins>
    </build>
    
  2. Set required version in plugin configuration section:

    <plugins> 
        <plugin> 
            <groupId>org.wildfly.plugins</groupId> 
            <artifactId>wildfly-maven-plugin</artifactId> 
            <version>1.0.2.Final</version> 
            <configuration> 
                <version>8.1.0.Final</version> 
            </configuration> 
        </plugin> 
    </plugins> 
    
  3. Pass required version using command-line argument:

    mvn wildfly:run -Dwildfly.version=8.1.0.Final
    

See plugin documentation for details.

Upvotes: 3

Related Questions