Hi Everyone,
I have an eclipse installation with several JREs installed (1.5,1.6 and 1.8). The selected one in the workspace preferences is the 1.8. (This mean that when an eclipse project is created, JRE 1.8 is used by default).
I have a project in the workspace with the JRE 1.6 in the build path.
I tried to add the log4j dependency using the eclipseClasspath
task of the eclipse plugin.
After the task execution the .classpath
file contains two JRE_CONTAINER entry (1.6 and 1.8).
I think that eclipseClasspath
task get the default Eclipse JRE variable (1.8 in this case) and add it in the classpath.
I wouldn’t add the JRE 1.8 in the classpath, i would add just the log4j dependencies (JRE 1.6 is already in the classpath).
Is it possible to configure the eclipseClasspath
task to exclude the JRE_CONTAINER from .classpath
generation?
NOTE 1: I’m looking for a clean solution, i wouldn’t loop the classpath entries and remove the duplicated JRE_CONTAINER entry.
NOTE 2: I’ve already seen this topic. I don’t want clean my classpath file
Below my build script
apply plugin: 'java'
apply plugin: 'eclipse'
group = 'it.ipzs.ws'
version = '0.2'
targetCompatibility = 1.5
jar {
manifest {
attributes 'Implementation-Title': 'soaputil-ws',
'Implementation-Version': version,
'Main-Class': 'it.ipzs.ws.util.SOAPUtil'
}
}
repositories {
jcenter()
mavenLocal()
}
//eclipse plugin configuration
configurations {
provided
}
dependencies {
compile 'log4j:log4j:1.2.16'
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
}
compileJava{
targetCompatibility = 1.5
}