Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10893

Elytron: problem with Maven dependencies

    XMLWordPrintable

Details

    • Hide

      Have a EJB Maven project with dependencies:

          <dependencies>
              <dependency>
                  <groupId>org.jboss.spec.javax.ejb</groupId>
                  <artifactId>jboss-ejb-api_3.2_spec</artifactId>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.wildfly.security</groupId>
                  <artifactId>wildfly-elytron</artifactId>
                  <scope>provided</scope>
              </dependency>
          </dependencies>
      

      Use the Elytron AuthenticationContext in your EJB:

      AuthenticationContext.empty()
          .with(MatchRule.ALL, AuthenticationConfiguration.EMPTY.useName(username).usePassword(password))
          .runCallable(callable);
      

      Project compilation then fails with:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project test: Compilation failure
      [ERROR] /path/to/project/src/main/java/org/wildfly/test/TestBean.java:[88,45] cannot access org.wildfly.common.context.Contextual
      [ERROR] class file for org.wildfly.common.context.Contextual not found
      
      Show
      Have a EJB Maven project with dependencies: <dependencies> <dependency> <groupId> org.jboss.spec.javax.ejb </groupId> <artifactId> jboss-ejb-api_3.2_spec </artifactId> <scope> provided </scope> </dependency> <dependency> <groupId> org.wildfly.security </groupId> <artifactId> wildfly-elytron </artifactId> <scope> provided </scope> </dependency> </dependencies> Use the Elytron AuthenticationContext in your EJB: AuthenticationContext.empty() .with(MatchRule.ALL, AuthenticationConfiguration.EMPTY.useName(username).usePassword(password)) .runCallable(callable); Project compilation then fails with: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project test: Compilation failure [ERROR] /path/to/project/src/main/java/org/wildfly/test/TestBean.java:[88,45] cannot access org.wildfly.common.context.Contextual [ERROR] class file for org.wildfly.common.context.Contextual not found

    Description

      Majority of Elytron Maven dependencies have scope provided. It means they are not included when Elytron is used as a project dependency (e.g. together with EJB) and compilation fails.

      We need either to make them compile scoped or provide an additional Elytron BOM package so users have a simple way for Elytron usage.

      Attachments

        Issue Links

          Activity

            People

              tomazcerar Tomaž Cerar (Inactive)
              josef.cacek@gmail.com Josef Cacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: