0

i'm tring to make a gradle Multi-project Builds but i have some problems with compiling, it said:

Failed to create MD5 hash for file content.

I have a root project that contains only resources and subrojects that contains only sources and i want to access this resources in every subproject. The paradox is that i made it to see all mai resources but dont work anything like : build, Run File... All bring me the same error and i dont know why. I want to make a one fat app server with emmbedded tomcat and springboot, and all dependencies i want them to be stored locally with flatDir This is my multi-project structure:

PROJECTS
-resources
  *media
  *libraries
-sources
 -SUBPROJECT1
 -SUBPROJECT2

My root build.gradle:

//description = 'projects'

allprojects {
  apply plugin: 'java'
}



sourceSets {
  main.resources.srcDir 'resources' 
}
repositories {
  flatDir dirs: '../resources'
}  
dependencies {
  compile fileTree(dir:'/')
  //  compile fileTree(dir:'/').filter{ it.isFile()}
}



subprojects {  
  sourceSets {
    main.java.srcDir '/'
  }
  dependencies {
    compile rootProject
  }
}

And this is my settings.gradle:

rootProject.name = 'projects'

include 'sources:SUBPROJECT_V0'
include 'sources:SUBPROJECT_V1'
include 'sources:SUBPROJECT_V2'

My dependencies was seen but only cannot compile anithing:

import java.io.File;

import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.webresources.DirResourceSet;
import org.apache.catalina.webresources.StandardRoot;
  • `compile fileTree(dir:'/')`you want to use all your file system as a compile dependency? Do yourself a favor, and respect the standard gradle project layout. Use a Maven repository for your dependencies rather than downloading them. Don't use the deprecated `compile`configuration. – JB Nizet Dec 08 '19 at 10:05
  • Yes, i want to compile everything that is under resources. There will be all, jars, htmls, css, js, pictures audio... I want to be somenthing generic that i can extend without modify the build. gradle file... I dont want to use maven at all. Just dont tell me what i want! This is also most for learning .. then i will optimise, first try download from maven then in case their server are death use locally... And also using gradle.properties to versionate my dependencies .. BUT FIRST: lets do it works this way! :) – Giurgiu Aron Dec 08 '19 at 10:14
  • I'm telling you that you don't want your entire file system to be in your compile dependencies and to be your source directory. That makes no sense at all. – JB Nizet Dec 08 '19 at 10:17
  • ok, then as you see: my repository will be under /resources/libraries... Oh, believe me that is what i want .. is make a lot of sense for me... This is a generic build platform... Here i will add whatever i need, when i need... and it will works... I'll do a task, that will copy specific dependencies and resources to build location based on a resources map, not all dependencies will be included... – Giurgiu Aron Dec 08 '19 at 10:32
  • Someone can help me ? Please ... – Giurgiu Aron Dec 17 '19 at 14:46
  • @JBNizet can you solutionate my case ? Please..! :) – Giurgiu Aron Dec 17 '19 at 14:47

0 Answers0