pulumi / pulumi-java

Java support for Pulumi
Apache License 2.0
64 stars 19 forks source link

ClassLoader loads all packages presented in pom #1385

Open andreaspartisia opened 3 weeks ago

andreaspartisia commented 3 weeks ago

What happened?

We used a packages wihich contains other not used packages, so these packages is not loaded by maven and therefore the class loader has a problem to load it. This will some out as a error on packages problem: SEVERE: Running program PID: 13236 failed with an unhandled exception: java.lang.IllegalStateException: Failed to load class 'org.apache.commons.compress.harmony.pack200.NewAttribute$ErrorAttribute' (package: 'org.apache.commons.compress.harmony.pack200') from class path: org/objectweb/asm/Attribute

Example

It is pom.xml excluding a package. We would like to only de it sometimes, because we have multiple class providers etc.

com.github.docker-java docker-java-core org.apache.commons commons-compress

Output of pulumi about

CLI
Version 3.112.0 Go Version go1.22.1 Go Compiler gc

Plugins NAME VERSION aws 6.40.0 command 0.10.0 eks 2.7.1 java unknown kubernetes 4.13.1

Host OS Microsoft Windows 11 Pro Version 10.0.22631 Build 22631 Arch x86_64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

justinvp commented 2 weeks ago

Thanks for the suggestion and PR. I left some comments.