The situation
I want to integrate a gradle script to specify the dependencies for JBoss AS 6 and use that script to create eclipse projects. We are currently using gradle for a project. It builds fine, and runs tests correctly, but when we try to import it into eclipse, we get errors. We have a property variable called jbossHome. I dumped all of the libs into one directory for jboss6 and that is what jbossHome points to.
repositories{
fileTree(dir: jbossHome) //include required JBoss jars
}
dependencies {
providedCompile fileTree(dir: jbossHome) // include the required JBoss jars
}
The problem
When we import into Eclipse, we get the following errors:
- Java compiler level does not match the version of the installed Java project facet.
- Target runtime jboss-6.0.0.Final Runtime is not defined.
We have both a web service project and a jms project that we need to set this up for.
Question #1
– How can I setup my project to use the maven repo and include/exclude the correct jars similar to this jboss 7 example?
Question #2
– If using the Maven repos, is there a way to specify it to cache it to a specific directory so it doesn’t download every time for integration into a CI server like Jenkins?
Note: I have been jumping around projects and languages, and I am not that familiar with Gradle or Maven. I am pretty familiar with CMake, but AFAIK there isn’t a similar concept with dependencies and maven repos.
The following gradle worked for me. I was also trying to deploy via war so I needed to make sure that I used providedCompile instead of compile otherwise every jboss .jar file ended up in the war file.
I hope this can help someone else.