question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SplitPackageProcessor picks up duplicates via test-jar that are not actually in that test-jar

See original GitHub issue

Describe the bug

With 2.1.0, when running tests in some of our modules, we are seeing this:

2021-07-27 16:57:00,819 WARN  [io.qua.arc.dep.SplitPackageProcessor] (build-28) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives: 
 - "de.somecompany.someproject.register.user" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.persistence.entity.id" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.catalog" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.somelib.persistence.transaction" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.somelib.logging" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.application.ehba" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.persistence.entity" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.password" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.application.smcb" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.confirmingauthority" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.somelib.persistence.entity.id" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.context" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.user.mapper" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.persistence.liquibase" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.persistence.entity.catalog" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.validation" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.persistence" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.file" found in [de.somecompany.someproject:register-core]
 - "de.somecompany.someproject.register.confirmingauthority.mapper" found in [de.somecompany.someproject:register-core]

What’s interesting is that only a single artifact is listed (de.somecompany.someproject:register-core). That register-core module is producing a test-jar that is present on the test classpath of the module that is issuing the warnings (here: register-api). That test-jar of register-core has a distinct package, but maybe the processor is somehow confused with this?

Expected behavior

No such warnings.

Actual behavior

Many warnings.

How to Reproduce?

See https://github.com/quarkusio/quarkus/issues/19030#issuecomment-889508677

Output of uname -a or ver

Linux W4DEUMSY9003463 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux But also happens on Jenkins.

Output of java -version

OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

n/a

Quarkus version or git rev

2.1.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.1

Additional information

n/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
famodcommented, Jul 29, 2021

@aloubyansky I recycled an older example project (which has a weird name 😉 ): https://github.com/famod/modmono-quarkus/tree/issue-19030-test-jar-index (make sure to switch to branch issue-19030-test-jar-index!)

mvn clean install will yield during testing in dist module:

WARN  [io.qua.arc.dep.SplitPackageProcessor] (build-5) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives:
- "com.github.famod.modmono_quarkus.core" found in [com.github.famod.modmono-quarkus:modmono-quarkus-core]

or with 999-SNAPSHOT a bit more detailed:

WARN  [io.qua.arc.dep.SplitPackageProcessor] (build-21) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives:
- "com.github.famod.modmono_quarkus.core" found in [com.github.famod.modmono-quarkus:modmono-quarkus-core::jar, com.github.famod.modmono-quarkus:modmono-quarkus-core:tests:jar]
1reaction
manovotncommented, Jul 28, 2021

How is that a problem here? Why should register-core (the main jar) be considered equal to register-core test-jar? Or am I getting you wrong?

You are correct that they shouldn’t be equal. All I am saying is that the Set<String> that is used in current impl introduces this problem because both your JARs will generate the same String.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found