Eclipse plugin generates absolute paths from a relative path to a repository


(andreas zingel) #1

I have following build.gradle

apply plugin: 'eclipse'
apply plugin: 'java'
  repositories {
    // mavenCentral()
 ivy {
  url "../svn-repo"
 }
}
  dependencies {
  compile group: 'org/restlet/jse', name: 'org.restlet', version: '2.1-RC5'
}
  buildDir = 'target/build'

If I generate the Eclipse .classpath I will get the absolute path for the dependencies. That’s not fine for more than one developer.

How can I resolve the problem?

– Andreas


(Peter Niederwieser) #2

You can use Eclipse path variables. For more information, see the EclipseClasspath documentation in the DSL reference.


(t3rm1.pro) #3

Can you go into detail please? The best solution would be to have a path relative to where the dependencies are cached.


(Karl-Johan Karlberg) #4

Sounds like you are comitting the ide metadata. I preffer not to do that. Have everybody generate their own metadata.

Or am I missing something?


(t3rm1.pro) #5

That’s right. Our classpath file for Eclipse is in the repository. The benefit is that you dont have to generate the classpath each time you check out something beacuse someone might have added a dependency. Is it possible to get a classpath file with paths relative to .m2/repository/. That way everyone can use the same classpath file