Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.Beta2:add-module-info failed: duplicate element: xxxxx #113

Open
mashrafi29 opened this issue Dec 23, 2019 · 4 comments · May be fixed by #160

Comments

@mashrafi29
Copy link

I am executing the following:

	                        <artifact>
	                            <groupId>io.vertx</groupId>
                                <artifactId>vertx-rx-java2</artifactId>
                                <version>${vertx.version}</version>
	                        </artifact> 
	                        <moduleInfo>
	                            <name>vertx.rx.java2</name>
	                        </moduleInfo>
	                    </module>

and the result is the following error about "duplicate element":

Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.Beta2:add-module-info failed: duplicate element: jffi

Any idea?

@bertramn
Copy link

For me this error happens when I have a maven project that contains 2 of the same libraries with different classifiers.

e.g. net.fs.saxon:Saxon-HE:9.9.1-7 and net.fs.saxon:Saxon-HE:9.9.1-7:xqj

Not sure how to fix that yet since the failure is triggered in jdeps but as a result of the ModiTect plugin creating the module info here.

@rlubke
Copy link

rlubke commented Apr 12, 2022

I seem to have this this issue as well.

Execution add-module-info of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: duplicate element: org.checkerframework.checker.qual -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info (add-module-info) on project coherence-grpc: Execution add-module-info of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: duplicate element: org.checkerframework.checker.qual

Dependencies:

org.checkerframework:checker-compat-qual:jar:2.5.5:compile
org.checkerframework:checker-qual:jar:3.5.0:provided

aseovic added a commit to aseovic/moditect that referenced this issue Apr 15, 2022
@aalmiray
Copy link
Contributor

aalmiray commented Mar 2, 2023

Well this is a problem as these two dependencies define the same module name (using Automatic-Module-Name) but with different contents

├── checker-compat-qual-2.5.5.jar
└── checker-qual-3.5.0.jar
$ jarviz module name --directory .
subject: checker-compat-qual-2.5.5.jar
name: org.checkerframework.checker.qual
source: manifest
automatic: true
valid: true

subject: checker-qual-3.5.0.jar
name: org.checkerframework.checker.qual
source: manifest
automatic: true
valid: true
$ jarviz module descriptor --directory .
subject: checker-compat-qual-2.5.5.jar
name: org.checkerframework.checker.qual
version: 2.5.5
open: false
automatic: true
requires:
  java.base mandated
contains:
  org.checkerframework.checker.nullness.compatqual

subject: checker-qual-3.5.0.jar
name: org.checkerframework.checker.qual
version: 3.5.0
open: false
automatic: true
requires:
  java.base mandated
contains:
  org.checkerframework.checker.compilermsgs.qual
  org.checkerframework.checker.fenum.qual
  org.checkerframework.checker.formatter
  org.checkerframework.checker.formatter.qual
  org.checkerframework.checker.guieffect.qual
  org.checkerframework.checker.i18n.qual
  org.checkerframework.checker.i18nformatter
  org.checkerframework.checker.i18nformatter.qual
  org.checkerframework.checker.index.qual
  org.checkerframework.checker.initialization.qual
  org.checkerframework.checker.interning.qual
  org.checkerframework.checker.lock.qual
  org.checkerframework.checker.nullness
  org.checkerframework.checker.nullness.qual
  org.checkerframework.checker.optional.qual
  org.checkerframework.checker.propkey.qual
  org.checkerframework.checker.regex
  org.checkerframework.checker.regex.qual
  org.checkerframework.checker.signature.qual
  org.checkerframework.checker.signedness
  org.checkerframework.checker.signedness.qual
  org.checkerframework.checker.tainting.qual
  org.checkerframework.checker.units
  org.checkerframework.checker.units.qual
  org.checkerframework.common.aliasing.qual
  org.checkerframework.common.reflection.qual
  org.checkerframework.common.returnsreceiver.qual
  org.checkerframework.common.subtyping.qual
  org.checkerframework.common.util.report.qual
  org.checkerframework.common.value.qual
  org.checkerframework.dataflow.qual
  org.checkerframework.framework.qual
  org.checkerframework.framework.util

The proposed fix may actually hide a problem which is same module name defined in two different JARs.

@aalmiray
Copy link
Contributor

I do believe that failing on duplicate modules is the way to. Perhaps the error message could be more descriptive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants