Reputation: 276
I am attempting to build an Eclipse Java project at the command-line using Ant. I will then use this within Jenkins. I have been using ant4eclipse with the associated documentation and examples, but cannot get past the below error. The closest thing in stackoverflow is ant4eclipse classpath problem but I cannot figure out how to adapt this to my situation. Any ideas?
BUILD FAILED
/home/phil/git/backend-testing/backend-tests/build.xml:31:
The following error occurred while executing this line:
/home/phil/git/backend-testing/backend-tests/a4e-jdt-macros.xml:77:
org.ant4eclipse.lib.core.exception.Ant4EclipseException:
Exception whilst resolving the classpath entry '[EclipseClasspathEntry: path:
org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVM
ype/JavaSE-1.7 entryKind: 0 outputLocation: null exported: false]' of project
'com.paralant.paravise.model': 'A precondition has been violated: The parameter
'javaProfile' is not supposed to be null.'
Upvotes: 2
Views: 2240
Reputation: 4525
For some reason, the Ant4Eclipse.org team has not updated their distribution binaries in a long while (since 2010!). This is strange because its under active development.
You can get the most recent successful build here:
http://hudson.nilshartmann.net/job/ant4eclipse/lastSuccessfulBuild/
https://github.com/ant4eclipse/ant4eclipse/releases
The classpath parsing is fixed in the latest versions.
Upvotes: 1
Reputation: 617
There is a brand-new release A4E_2018-01-03 on GitHub:
https://github.com/ant4eclipse/ant4eclipse/releases
Use <installedJREs>
to define your runtime environment. But there is now also a default that worked for me.
Upvotes: 0
Reputation: 41
ant4eclipse doesn't include the necessary profile for JDK 1.7. Here's how I solved the problem: Inside the org.eclipse.osgi_*.jar in the /plugins directory of Eclipse the new JavaSE-1.7.profile and the updated profile.list can be found. Copy those into the ant4eclipse jar file under /profiles and everything should be fine
Upvotes: 2