3 Replies Latest reply on Aug 22, 2016 12:19 PM by Wolfgang Mayer

    Migrating official Javaee-tutorial examples from GlassFish to WildFly

    Kunal Choudhary Newbie

      ...

          <build>

              <finalName>${project.artifactId}</finalName>

              <plugins>

                  <plugin>

                      <groupId>org.codehaus.mojo</groupId>

                      <artifactId>exec-maven-plugin</artifactId>

                      <version>1.5.0</version>

                      <configuration>

                          <skip>true</skip>

                          <executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>

                      </configuration>

                  </plugin>

              </plugins>  

          </build>

      ..

       

      There are several POM files in the examples using the exec maven plugin with- <executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>.

      In some cases, there additional configurations specified within <configuration>..</configuration>.

       

      ...

          <build>

              <finalName>${project.artifactId}</finalName>

              <plugins>

                  <plugin>

                      <groupId>org.codehaus.mojo</groupId>

                      <artifactId>exec-maven-plugin</artifactId>

                      <version>1.5.0</version>

                      <executions>

                          <execution>

                              <phase>compile</phase>

                              <goals>

                                  <goal>exec</goal>

                              </goals>

                          </execution>

                      </executions>

                      <configuration>

                          <skip>false</skip>

                          <executable>{glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>

                          <successCodes>

                              <successCode>0</successCode>

                              <successCode>1</successCode>

                          </successCodes>

                          <arguments>

                              <argument>create-auth-realm</argument>

                              <argument>--classname=com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm</argument>

                              <argument>--property=jaas-context=jdbcRealm:datasource-jndi=java\:global/ForestDataSource:user-table=forest.PERSON:user-name-column=email:password-column=password:group-table=forest.GROUPS:group-table-user-name-column=name:group-name-column=name:assign-groups=USERS,ADMINS:digest-algorithm=MD5</argument>

                              <argument>jdbcRealm</argument>

                          </arguments>

                      </configuration>

                  </plugin>

              </plugins>     

          </build>

      ...

      How do I change such GlassFish dependencies to work with Wildfly 10?

        • 1. Re: Migrating official Javaee-tutorial examples from GlassFish to WildFly
          Wolfgang Mayer Master

          I don't think there is an easy approach to this.

          The <executable> points to the asadmin utility.

          So you would have to replace this entry with the corresponding WildFly utility (eg $JBOSS_HOME/bin/jboss-cli.sh).

          But you would also have to adjust the <arguments> accordingly.

          And there are also features in Glassfish (eg authorization) which are implemented differently in WildFly (or even to not exist at all).

          You might even have to configure the plugins (like the cargo-maven2-plugin)

          • 2. Re: Migrating official Javaee-tutorial examples from GlassFish to WildFly
            Tomaz Cerar Master

            Wolfgang Mayer wrote:

             

            And there are also features in Glassfish (eg authorization) which are implemented differently in WildFly (or even to not exist at all).

            You might even have to configure the plugins (like the cargo-maven2-plugin)

            You can do all that with WildFly Maven Plugin – Introduction

            • 3. Re: Migrating official Javaee-tutorial examples from GlassFish to WildFly
              Wolfgang Mayer Master

              Tomaz, I assume that you've already got some experience with migrating GlassFish projects to WildFly. It sounds great that you can do all that wth the WildFly Maven Plugin.

              So maybe you can also help in migrating the tutorial projects:

              For example the pom.xml in the cart-ear from the 'ejb' project calls asadmin with the argument 'get-client-stubs'. The GlassFish documentation states:

               

              "The get-client-stubs subcommand copies the required JAR files for an AppClient standalone module or each AppClient module in an application from the server machine to the local directory. Each client's stub JAR file is retrieved separately, along with any required supporting JAR files".

               

              Unfortunately I have so far no idea how this could be done in WildFly. And I've also not found a solution in the WildFly Maven Plugin.