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

Elytron: problem with Maven dependencies

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.1.0.CR5, 1.2.0.Beta1
    • 1.1.0.CR4
    • None
    • None
    • 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

      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.

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

                Created:
                Updated:
                Resolved: