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

Do not add excluded modules or dependencies to the jdeps call #159

Open
mdreier-sap opened this issue Nov 12, 2021 · 0 comments
Open

Do not add excluded modules or dependencies to the jdeps call #159

mdreier-sap opened this issue Nov 12, 2021 · 0 comments

Comments

@mdreier-sap
Copy link

In my project, I am using a non-defaul slf4j implementation. Therefor, in my dependencies, I have excluded the "normal" sl4j dependency.

		<dependency>
			<groupId>com.github.tulskiy</groupId>
			<artifactId>jkeymaster</artifactId>
			<version>${jkeymaster.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-jdk14</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

In addition, I have configured moditect to not include these dependencies:

<module>
	<artifact>
		<groupId>com.github.tulskiy</groupId>
		<artifactId>jkeymaster</artifactId>
		<version>${jkeymaster.version}</version>
	</artifact>
	<moduleInfo>
		<name>jkeymaster</name>
		<requires>!slf4j.api;!slf4j.jdk14;org.slf4j;*;</requires>
	</moduleInfo>
	<additionalDependencies>
		<additionalDependency>
			<groupId>com.guicedee.services</groupId>
			<artifactId>slf4j</artifactId>
			<version>${guicedee.version}</version>
		</additionalDependency>
	</additionalDependencies>
</module>

And yet, in the call to jmod, the excluded dependencies are explicitly added with the parameter --add-modules:

[DEBUG] Running jdeps --generate-module-info C:\dev\git\project\target\moditect --add-modules com.sun.jna,com.sun.jna.platform,slf4j.api,slf4j.jdk14,org.slf4j --module-path C:\dev\git\project\target\modules\jna-5.4.0.jar;C:\dev\git\project\target\modules\jna-platform-5.4.0.jar;C:\usr\maven\repository\org\slf4j\slf4j-api\1.7.13\slf4j-api-1.7.13.jar;C:\usr\maven\repository\org\slf4j\slf4j-jdk14\1.7.13\slf4j-jdk14-1.7.13.jar;C:\usr\maven\repository\com\guicedee\services\slf4j\1.2.0.3-jre17-rc1\slf4j-1.2.0.3-jre17-rc1.jar --multi-release 17 C:\usr\maven\repository\com\github\tulskiy\jkeymaster\1.3\jkeymaster-1.3.jar

This, of course, fails:

Error: Module slf4j.api contains package org.slf4j, module org.slf4j exports package org.slf4j to slf4j.api

My suggestion would be to ensure that excluded modules do not appear in the call.

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

No branches or pull requests

1 participant