12 Aralık 2021 Pazar

wildfly plugin - Deploys war to local Wildfly

Giriş
Açıklaması şöyle
WildFly project itself provides a great maven plugin to deploy Jakarta EE application to an embedded server, an existing server, or a running server.
package
Örnek
Şöyle yaparız. Burada feature pack ekleniyor
<plugin>
  <groupId>org.wildfly.plugins</groupId>
  <artifactId>wildfly-maven-plugin</artifactId>
  <version>4.0.0.Beta2</version>
  <configuration>
    <feature-packs>
      <feature-pack>
        <location>org.wildfly:wildfly-galleon-pack:26.1.1.Final</location>
      </feature-pack>
    </feature-packs>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>package</goal>
      </goals>
    </execution>
  </executions>
</plugin>
deploy Goal
Örnek
Şöyle yaparız
<!-- The WildFly plugin deploys your war to a local WildFly container -->
<!-- To use, set the JBOSS_HOME environment variable and run: 
     mvn package wildfly:deploy -->
<plugin>
  <groupId>org.wildfly.plugins</groupId>
  <artifactId>wildfly-maven-plugin</artifactId>
  <version>${version.wildfly.maven.plugin}</version>
</plugin>
Şöyle yaparız
# Make sure you have started the local JBoss Server
# This will deploy target/wildfly-cmt.war to the running instance of the server.
mvn clean package wildfly:deploy
...

Örnek
Şöyle yaparız. Burada install aşamasında deploy etme seçenekleri veriliyor.
<properties>
  <deploy.jboss.host>127.0.0.1</deploy.jboss.host>
  <deploy.jboss.port>9990</deploy.jboss.port>
  <deploy.jboss.username>wildfly</deploy.jboss.username>
  <deploy.jboss.password>wildfly</deploy.jboss.password>
</properties>

<plugin>
  <groupId>org.wildfly.plugins</groupId>
  <artifactId>wildfly-maven-plugin</artifactId>
  <version>2.0.2.Final</version>
  <executions>
    <execution>
      <phase>install</phase>
      <goals>
        <goal>deploy</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <filename>${project.build.finalName}.war</filename>
    <hostname>${deploy.jboss.host}</hostname>
    <port>${deploy.jboss.port}</port>
    <username>${deploy.jboss.username}</username>
    <password>${deploy.jboss.password}</password>
    </configuration>
</plugin>
Şöyle yaparız
mvn clean install
run goal
Örnek
Şöyle yaparız
mvn clean wildfly:run -Pwildfly




Hiç yorum yok:

Yorum Gönder

Local Snapshot Kullanmak

Örnek Şöyle yaparız <repository> <id>snapshot-repository</id> <name>Maven2 Snapshot Repository</name> &l...