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

Version 1.16.0 renames Delombok, now inaccessible #810

Closed
lombokissues opened this issue Jul 14, 2015 · 6 comments
Closed

Version 1.16.0 renames Delombok, now inaccessible #810

lombokissues opened this issue Jul 14, 2015 · 6 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 775)

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Jan 27, 2015 at 06:20 UTC

I'm trying to update the lombok-maven-plugin for the 1.16.0 release and am running into a build problem:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project lombok-maven-plugin: Compilation failure: Compilation failure:
[ERROR] /Users/anthony/Documents/lombok.maven/lombok-maven-plugin/src/main/java/lombok/maven/AbstractDelombokMojo.java:[19,23] package lombok.delombok does not exist
[ERROR] /Users/anthony/Documents/lombok.maven/lombok-maven-plugin/src/main/java/lombok/maven/AbstractDelombokMojo.java:[20,32] package lombok.delombok.Delombok does not exist

It looks like the classes were renamed:
lombok/delombok/Delombok.class
is now:
lombok/delombok/Delombok.SCL.lombok

My code needs to import Delombok, but how can it given the rename? (I'm surprised that the extension doesn't need to be .class.)

How does your AntTask deal with this?

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Jan 27, 2015 at 12:35 UTC

Hmm, I don't know if we updated that one :-)

I don't have an exact solution but you need to use lombok.launch.Main﹟createShadowClassLoader() or similar code to create a classloader that's aware of the SCL.lombok files, and use Class.forName on that classloader to load your own code.

I think you either need to use reflection or have at least one of your classes in the same package since all (or at least most) of the code involved is package private.

We will need to consider a public API, and also update the AntTask.

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Jan 28, 2015 at 09:42 UTC

OK, it was a bit of a pain, but I think I got this working based on your advice. Thanks.

BTW... I thought that this kind of obfuscation was not necessary with OSGi.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jan 30, 2015 at 02:43 UTC

OSGi makes this kind of obfuscation mostly unneccessary, but we can't very well demand OSGi from all our users, so we went with this solution. Unlike OSGi, the shadowloader doesn't have any restrictions.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jan 30, 2015 at 02:47 UTC

ant task now fixed with full hiding, though regrettably the ant task classname has been changed, which isn't backwards compatible.

Fixed in 8ed49ce

@lombokissues
Copy link
Author

End of migration

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