Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-1153

Elytron: problem with Maven dependencies

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 1.1.0.CR4
    • Fix Version/s: 1.1.0.CR5, 1.2.0.Beta1
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ctomc Toma┼ż Cerar
                  Reporter:
                  jcacek Josef Cacek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: