I have a question in creating ear file. I have a requirement to add the war file under ear file and few other folder/files along with it.
I verified few articles, posting and Gradle guide which says to add the below command under dependencies
deploy project(path: ‘:war’, configuration: ‘archives’)
But when I try this then I am getting an exception. Could you please guide me on how to add war file under ear.
Pavan Note: This topic was created from a reply on the Ear build with specific appDirName path topic.
What exception do you get?
Thanks for your response. Below is the exception which I am getting
FAILURE: Build failed with an exception.
Where: Build file ‘C:\workspace-cord\ERIM\build.gradle’ line: 8
What went wrong: A problem occurred evaluating root project ‘ERIM’. > Project with path ‘:war’ could not be found in root project ‘ERIM’.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 7.186 secs
in the snippet
deploy project(path: ':war', configuration: 'archives')
‘:war’ is referencing your war project. It seems that your war project has a different name. you must replace ‘:war’ with the correct project path.
Thanks for the reply. Sorry that I was out of station so responding late. Here is the code snippet which I am using. Please advice.
apply plugin: ‘java’ apply plugin: ‘war’ apply plugin: ‘eclipse’ apply plugin: ‘ear’
compile fileTree(dir: ‘WebRoot/WEB-INF/lib’, includes:[’*.jar’])
deploy project(path: “:erim”, configuration: “archives”)