3 Replies Latest reply on Aug 18, 2018 3:19 PM by Eudris Cabrera Rodriguez

    EE 8 Maven Dependency

    Dennis Gesker Newbie

      For a WildFly 13 project what is the correct maven dependency to ensure the correct/current ee 8 libs are used?

      I'd like to add a providedCompile entry to my gradle build.

       

      Thanks,

      Dennis

        • 1. Re: EE 8 Maven Dependency
          Eudris Cabrera Rodriguez Newbie

          Hi,

           

          Gradle

          // https://mvnrepository.com/artifact/javax/javaee-api

          provided group: 'javax', name: 'javaee-api', version: '8.0'

           

          Maven

           

          <!-- https://mvnrepository.com/artifact/javax/javaee-api -->

          <dependency>

              <groupId>javax</groupId>

              <artifactId>javaee-api</artifactId>

              <version>8.0</version>

              <scope>provided</scope>

          </dependency>

           

          If you only need the web profile, you can use javaee-web-api

           

          Gradle

           

          // https://mvnrepository.com/artifact/javax/javaee-web-api

          provided group: 'javax', name: 'javaee-web-api', version: '8.0'

           

          Maven

           

          <!-- https://mvnrepository.com/artifact/javax/javaee-web-api -->

          <dependency>

              <groupId>javax</groupId>

              <artifactId>javaee-web-api</artifactId>

              <version>8.0</version>

              <scope>provided</scope>

          </dependency>

           

          Good Luck !

          • 2. Re: EE 8 Maven Dependency
            Dennis Gesker Newbie

            Hi Eudris:

             

            Thanks so much for your reply to my question.

             

            I'm presently using:

             

            providedCompile 'org.wildfly:wildfly-spec-api:13.0.0.Final' and starting

            WildFly 13 in "EE 8 mode"

             

            For this new little project mostly I want to be ready for WildFly 14 --

            which I think, but don't know for 100% sure, will be fully EE 8

            compliant/ready.

             

            Do you see using the wildfly-spec-api artifact as OK or is it a best

            practice to use the  'javax:javaee-api:8.0' artifact?

             

            (The POM for wildfly-spec-api seems to have both EE 7 and EE 8

            dependencies.)

             

            Cordially,

            Dennis

            • 3. Re: EE 8 Maven Dependency
              Eudris Cabrera Rodriguez Newbie

              By specifying the org.wildfly:wildfly-spec-api:13.0.0.Final, Gradle will be able to trigger transitive dependencies automatically so you have the full wildfly 13 stack available. The providedCompile directive ensures that the WildFly libraries aren't packaged in the WEB-INF/lib folder.

               

              But you have to remember, by default WildFly 13 launches in EE7 mode. In order to use EE8 you have to enable the preview mode.

               

              I'm using Java EE 8 independently of the application server, in this way, we use the javaee-api dependency and WildFly 13. But  wildfly dependency are not declare in the build.gradle file.

               

              With this aproach we have some advantages, we can deploy in any application server compatible with Java EE 8, if you use the wildfly dependency you can only use wildfly or maybe Thorntail (formed wildfly swarm)

               

              Good luck !