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

ant intellij fails with IllegalStateException #1956

Closed
lestephane opened this issue Nov 23, 2018 · 10 comments
Closed

ant intellij fails with IllegalStateException #1956

lestephane opened this issue Nov 23, 2018 · 10 comments

Comments

@lestephane
Copy link

when doing:

$ git clone ...lombok.git && cd lombok
$ ant intellij

It fails with:

BUILD FAILED
/home/lestephane/GitRepos/lombok/build.xml:386: java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.eclipse.platform#org.eclipse.core.filesystem;[1.3.0,2.0.0)
	at org.apache.ivy.core.resolve.IvyNode.getArtifacts(IvyNode.java:811)
	at com.zwitserloot.ivyplusplus.intellij.BuildIntellijProject.generateLibraryXml(Unknown Source)
	at com.zwitserloot.ivyplusplus.intellij.BuildIntellijProject.doExecute(Unknown Source)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:271)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.Main.runBuild(Main.java:853)
	at org.apache.tools.ant.Main.startAnt(Main.java:235)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

I have no clue what to do.

Full output of the command: trace.txt

@trks1970
Copy link

Same for me.

@mshassium
Copy link

same problem.
logs.txt

@sjacek
Copy link

sjacek commented Feb 3, 2019

same problem
logs.txt

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Apache Ant(TM) version 1.10.3 compiled on July 19 2018

@IgnatBeresnev
Copy link

Same here... I can only imagine how many people have been discouraged and didn't contribute just because they couldnt set up the environment properly...

@sjacek
Copy link

sjacek commented Feb 20, 2019

Yep... I wanted to contribute new annotation @LiferayLog, but for now it's impossible for me... :-(

@cberes
Copy link

cberes commented Apr 13, 2019

Seems to be a problem with a transitive dependency of org.eclipse.jdt.compiler.apt https://github.com/rzwitserloot/lombok/blob/master/buildScripts/ivy.xml#L48

I tried using the latest version of vanilla ivy, but I got the same error message.

Then I tried removing the dependency, and ant intellij succeeded. Not sure if you'll be able to build the project with Intellij, but it's a workaround to get started.

@YuShanMuGong
Copy link

Seems to be a problem with a transitive dependency of org.eclipse.jdt.compiler.apt https://github.com/rzwitserloot/lombok/blob/master/buildScripts/ivy.xml#L48

I tried using the latest version of vanilla ivy, but I got the same error message.

Then I tried removing the dependency, and ant intellij succeeded. Not sure if you'll be able to build the project with Intellij, but it's a workaround to get started.

yes!! I remove this line ,then get success!

@pimotte
Copy link

pimotte commented Nov 15, 2019

I've done a little bit of research to try and find out the underlying issue here.
As mentioned, the IvyNode org.eclipse.platform#org.eclipse.core.filesystem;[1.3.0,2.0.0) causes the problem.

Further up in the build log for me there is the following line:

[ivy:resolve] 	org.eclipse.platform#org.eclipse.core.filesystem;[1.3.0,2.0.0) by [org.eclipse.platform#org.eclipse.core.filesystem;1.7.500] in [ecj9, contrib]

The call in ivyplusplus that triggers the error is this one

The error triggers because the md (ModuleDescriptor) variable is null.

I've tried rebuilding ivyplusplus with ivy-2.5.0, but that did not resolve the issue.

I don't (yet) have enough knowledge of ivy(plusplus) to pinpoint the exact issue, but maybe someone else finds this useful.

@furstenheim
Copy link

Removing the last part and leaving:

<dependency org="org.eclipse.jdt" name="org.eclipse.jdt.compiler.apt" rev="1.3.300" conf="ecj9->default;" />

Also seems to work

@rzwitserloot
Copy link
Collaborator

I've fixed the issue in IvyPlusPlus and updated the lombok build script to require the updated version.

Before the various folks who are waiting for this go forth and make fun new features, please contact us first – we have to maintain your contribution, we are the guardians of the lombok learning curve, as well as the standards that it has in terms of quality of the feature as well as whether we 'like' what it inherently recommends about how you write java code. Failure to contact us might result in us being forced to deny your pull request and then we all feel bad.

Our build script used to just error out if you ran ant intellij, saying explicitly that we don't support this due to lack of resources on our side to maintain it. I'm a bit confounded; did everybody in this thread who found solutions just disable that without mentioning it?

At any rate, now that ant intellij does something (no idea if it does the right thing, as a non-intellij user it'd be a big task for me to attempt to figure out if it does the right thing in the first place!), I've removed the <fail>, but replaced it instead with a warning that you have to enter through first:

** WARNING ** The core lombok contributors all use eclipse to develop lombok. We have some ability on letting you work on lombok via intellij, but whether the generated project can be used in a modern intellij is currently unknown. Please do continue, but be aware that trying to work on lombok from intellij may run into problems. If you want to adopt 'work on lombok via intellij' as a task, we're open to it!

We still need this, in other words!

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

10 participants