Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2300 Weld build on JDK 9 EA 148+
  3. WELD-2305

Weld 3.x Core and API package name clash

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Major
    • 3.0.0.CR1
    • 3.0.0.Beta1
    • None

    Description

      When building a modular JDK 9 project, any pom.xml dependency will be added onto module path. If that dependency is not a module itself, it will be converted to an "automatic module".

      This is the case if someone uses Weld in JDK 9 project.
      JDK 9 also poses a strict requirement on modules, similar to what was up until now known as sealed JAR. That means you cannot have the same package coming from more than one JAR (or module in this case).

      If the project depends on Weld Core and Weld API, we got a problem. Both projects have many same packages.

      Reproducer can be found within my playground project. Just build it with JDK 9.

      Here is a stacktrace of clashing packages:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project JDK9Playground: Compilation failure: Compilation failure:
      [ERROR] module  reads package org.jboss.weld.context from both weld.core.impl and weld.api
      [ERROR] module  reads package org.jboss.weld.context.bound from both weld.core.impl and weld.api
      [ERROR] module  reads package org.jboss.weld.context.activator from both weld.core.impl and weld.api
      [ERROR] module  reads package org.jboss.weld.context.unbound from both weld.core.impl and weld.api
      [ERROR] module weld.core.impl reads package org.jboss.weld.context from both weld.api and weld.core.impl
      [ERROR] module weld.core.impl reads package org.jboss.weld.context.bound from both weld.api and weld.core.impl
      [ERROR] module weld.core.impl reads package org.jboss.weld.context.activator from both weld.api and weld.core.impl
      [ERROR] module weld.core.impl reads package org.jboss.weld.context.unbound from both weld.api and weld.core.impl
      [ERROR] module javax.inject reads package org.jboss.weld.context from both weld.api and weld.core.impl
      [ERROR] module javax.inject reads package org.jboss.weld.context.bound from both weld.api and weld.core.impl
      [ERROR] module javax.inject reads package org.jboss.weld.context.activator from both weld.api and weld.core.impl
      [ERROR] module javax.inject reads package org.jboss.weld.context.unbound from both weld.api and weld.core.impl
      [ERROR] module cdi.api reads package org.jboss.weld.context from both weld.api and weld.core.impl
      [ERROR] module cdi.api reads package org.jboss.weld.context.bound from both weld.api and weld.core.impl
      [ERROR] module cdi.api reads package org.jboss.weld.context.activator from both weld.api and weld.core.impl
      [ERROR] module cdi.api reads package org.jboss.weld.context.unbound from both weld.api and weld.core.impl
      [ERROR] module weld.environment.common reads package org.jboss.weld.context from both weld.api and weld.core.impl
      [ERROR] module weld.environment.common reads package org.jboss.weld.context.bound from both weld.api and weld.core.impl
      [ERROR] module weld.environment.common reads package org.jboss.weld.context.activator from both weld.api and weld.core.impl
      [ERROR] module weld.environment.common reads package org.jboss.weld.context.unbound from both weld.api and weld.core.impl
      [ERROR] module weld.api reads package org.jboss.weld.context from both weld.core.impl and weld.api
      [ERROR] module weld.api reads package org.jboss.weld.context.bound from both weld.core.impl and weld.api
      [ERROR] module weld.api reads package org.jboss.weld.context.activator from both weld.core.impl and weld.api
      [ERROR] module weld.api reads package org.jboss.weld.context.unbound from both weld.core.impl and weld.api
      [ERROR] module weld.se.core reads package org.jboss.weld.context from both weld.api and weld.core.impl
      [ERROR] module weld.se.core reads package org.jboss.weld.context.bound from both weld.api and weld.core.impl
      [ERROR] module weld.se.core reads package org.jboss.weld.context.activator from both weld.api and weld.core.impl
      [ERROR] module weld.se.core reads package org.jboss.weld.context.unbound from both weld.api and weld.core.impl
      
      

      Attachments

        Activity

          People

            manovotn Matěj Novotný
            manovotn Matěj Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: