简体   繁体   中英

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM