1

I have a huge project that is a set of about 40 subprojects. It is built with an Ant script.

In each subproject I have some library dependencies, split in a set of folders (lets say: 'lib1', 'lib2', and so on). It's a huge problem mantaining these libraries.

So, my team decided to move on a more modern built system. We decided to go on Gradle. At this moment, the only thing we will be performed with Gradle is the dependency management.

The lib sets ('lib1', 'lib2' etc) will be each of them put in different folders during the distribution phase. Some of them will not be distributed (are used on for compiling).

The structure so far is like this:

Root project
     |- settings.gradle
     |- project1
     |     |- build.gradle
     |- project2
     |     |- build.gradle
     ...

The root project only includes the subprojects by include ':project1' and so on.

We have now two main challenges:

Download the projects dependencies in different folders depending on the dependency type and check if there are dependencies conflicts.

We presume (but not sure) that we will have to declare some configurations, like:

configurations{
    lib1
    lib2
    compile.extendsFrom(lib1, lib2)
}

Just to be clear, I'd like to download each lib set in a folder like dist/lib1. The Ant script will continue to gather these libs and copying them in to the dest folder.

So, the following questions that remain:

  • How to declare the dependencies configurations (The above format doesn't seem to work, since compileJava does not include them (although compile configuration extends from them)).

  • How to download the dependencies in a given folder.

  • How to check dependencies from all subprojects at once.

Edit: I just found this question which answered questions number 1 and 2. But, when I ran this task:

task copyWebinf( type: Copy ) {
    into "$buildDir/libs/WEB-INF"
    from configurations.webinf
}

I noticed that I have some libs that I suspect are dupicates:

-rw-rw-r-- 1 thiago thiago   93395 Nov  7 18:00 xpp3-1.1.3.3.jar
-rw-rw-r-- 1 thiago thiago   24956 Nov  7 18:00 xpp3_min-1.1.4c.jar

and

-rw-rw-r-- 1 thiago thiago  246867 Nov  7 18:00 xstream-1.1.2.jar
-rw-rw-r-- 1 thiago thiago  411090 Nov  7 18:00 xstream-1.3.jar

These duplicates might be related to my question number 3 (dependency check).

Berne
  • 617
  • 1
  • 7
  • 17

0 Answers0