Java 7, Gradle 1.11, Eclipse Kepler
I have yet another prototype with two projects. First one is war project (lets name it main-project) and second is sub-project (jar). Idea is to reuse sub-project in many various projects, providing common classes and beans like language handling, configuration etc. Currently sub-project is compiled as sub-project.jar that is put in \WEB-INF\lib of main-project.war.
And here lies problem. Sub-project has beans. CDI does not like that these beans are in jar and cannot resolve them. I have to have compiled files directly in main war directories, like it was in main-project, not in sub-project.
Both projects has plugins java, maven, eclipse, but main project has additionally war plugin.
main gradle file:
defaultTasks 'clean', 'build', 'deploy'
allprojects {
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
sourceCompatibility = 1.7
targetCompatibility = 1.7
...
}
build.gradle for main-project:
apply plugin: 'war'
dependencies {
compile project(':sub-project')
}
I do not want separate sub-project.war. I want sub-project compiled classes and other files to land in main-project.war: code to WEB-INF\classes, things in webapp directly to root of war - exactly like it was in main-project. How I can do that?