Hello,
I’m with a problem to compile a java legacy project with a very complicated structure. I can not chage this scructure.
The system is divided in 2 java project, one with the active code that need to generated a EAR file and other with the unit test classes that need to be compiled and run.
JAVA_PROJECT
src1
src2
src3
app
javaproject.ear
javaproject1.war
javaproject2.war
META-INF
application.xml
lib
*.jar
JAVA_PROJECT_TEST
src1_test
src2_test
src3_test
I thought to use gradle because many people said that is more flexible that maven. I don´t know if the problem is with me or gradle is not so flexible as I thought. I have been looking in the internet but do not find a way to build my project.
I tried to declare the test project in the file settings.gradle of the JAVA_PROJECT:
project(':JAVA_PROJECT_TEST').projectDir = new File(settingsDir, '../JAVA_PROJECT_TEST')
But it never find this project: Project with path ‘:JAVA_PROJECT_TEST’ could not be found.
The support a multi projects is not working the multi java projects. When you declare a project in the build file:
project(':JAVA_PROJECT_TEST') {
}
The follow error appears: Project with path ‘:JAVA_PROJECT_TEST’ could not be found.
What I need is compile the JAVA_PROJECT, compile the JAVA_PROJECT_TEST, execute the unit tests in JAVA_PROJECT_TEST, generated the JAVA_PROJECT.ear with the JAVA_PROJECT.jar, 2 JAVA_PROJECT.war and
a “lib” directory with all *jar dependences. All this inside the JAVA_PROJECT.ear file.
1st - build JAVA_PROJECT generating the JAVA_PROJECT.jar
2nd - build JAVA_PROJECT_TEST with JAVA_PROJECT.jar as dependence
3rd - run JAVA_PROJECT_TEST tests
4th - build JAVA_PROJECT1.war and build JAVA_PROJECT2.war
5th - create e JAVA_PROJECT.EAR with the JAVA_PROJECT.jar, JAVA_PROJECT1.war, JAVA_PROJECT2.war
and “lib” directory inside it.
Can someone give a help? Please