Announcement Announcement Module
No announcement yet.
How to use "remap Jars to maven projects" feature Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use "remap Jars to maven projects" feature


    I'm using the eclipse-integration-gradle plugin and I want to know how does the "Remap Jars to maven projects" feature works (see the attached screenshot).


    Here is the original motivation for this question:

    Thanks in advance,
    Attached Files

  • #2
    This info may be hard to find. Here is a link to a interesting comment in the original issue ticket about implementing this feature.

    Summary: for the feature to work you have to publish the jar at least once to some maven repo. This can be the local maven repository. I.e. unless gradle can resolve the jar as a maven style dependency then it won't work.

    Setup will be something like the following example. I'll include the full sample code in a zip attachement.

    It has two projects one callled 'main' and another called 'myLib'. Main depends on myLib. Main is a gradle project and myLib a maven project.

    In main/build.gradle you have something like this:

    repositories {
    dependencies {
        compile group: 'com.kdvolder', name: 'myLib', version: '0.0.1-SNAPSHOT'	
    In myLib/pom.xml something like this:
    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    Make sure to publish the jar at least once to your maven local repository by running something like 'mvn clean install' command in the maven project. Either on the commandline or via m2e tooling. It doesn't really matter.

    Verify that 'main' project
    - has 'Dependency Management' option enabled.
    - You have the 'remap ...' option enabled in the global preferences.

    Run a 'Refresh all' or 'Refresh Dependencies' command on 'main' from the Gradle context menu. This should update the dependencies in the project, replacing the jar dependency with a Eclipse project dependency.

    Further refreshes will maintain this project level dependency as long as the version number for 'myLib' in your project matches that in the gradle dependency.

    You don't have to refresh or republish anything if you make changes to 'myLib'.


    • #3
      This is exactly what I was looking for. Thanks!