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

Check enforcer plugin without cache #139

Closed
koppor opened this issue Sep 8, 2023 · 3 comments
Closed

Check enforcer plugin without cache #139

koppor opened this issue Sep 8, 2023 · 3 comments
Labels
question Further information is requested

Comments

@koppor
Copy link
Contributor

koppor commented Sep 8, 2023

I have issues to get this plugin to compile locally

[INFO] Rule 9: org.codehaus.mojo.extraenforcer.dependencies.BanDuplicateClasses passed
[INFO] Adding ignore: module-info
[INFO] Restricted to JDK 8 yet com.github.nbbrd.heylogs:heylogs-api:jar:0.6.1-SNAPSHOT:compile contains nbbrd/heylogs/spi/FormatBatch.class targeted to JDK 9
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for heylogs 0.6.1-SNAPSHOT:
[INFO]
[INFO] heylogs ............................................ SUCCESS [  0.459 s]
[INFO] heylogs-api ........................................ SUCCESS [  6.875 s]
[INFO] heylogs-cli ........................................ FAILURE [  0.276 s]
[INFO] heylogs-maven-plugin ............................... SKIPPED
[INFO] heylogs-bom ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.790 s
[INFO] Finished at: 2023-09-08T13:36:40+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.4.0:enforce (enforce) on project heylogs-cli:
[ERROR] Rule 10: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion failed with message:
[ERROR] Found Banned Dependency: com.github.nbbrd.heylogs:heylogs-api:jar:0.6.1-SNAPSHOT

The "only" difference between my setup and the setup on GitHub is IMHO the caching.

Could it be possible that com.github.nbbrd.heylogs:heylogs-api:jar:0.6.1-SNAPSHOT is cached on GitHub - and therefore "Rule 10" does not trigger there, but locally here?

@koppor
Copy link
Contributor Author

koppor commented Sep 8, 2023

Workaround: Activate the "right" profiles:

image

@charphi
Copy link
Member

charphi commented Sep 13, 2023

I'm not sure about the origin of the problem but my guess is that it is related to the 2-pass build.

Heylogs is a Java8 library distributed with a JPMS module-info. This is done by compiling the code twice. The first compilation compiles everything with Java9+ and the second one compiles evererything except module-info.java with Java8.

My advice would be to properly clean the target folders before doing anything else so that Maven enforcer doesn't complain about unexcepted files.

@charphi charphi added the question Further information is requested label Sep 13, 2023
@koppor
Copy link
Contributor Author

koppor commented Sep 13, 2023

Cleaning did not work: #138, but now it works. And this issue is "somehow" solved.

I needed to move away from Java 8 at #146. Not sure about al implications though. 😅

@koppor koppor closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants