I have a verysimple Gradle project called MyApp. MyApp is built as an .ear file 
thatcontains a .war file with a test.jsp page. Gradle can build it and the app 
willrun in TomEE if I deploy the .ear file manually to the /webapps folder.    
Now I'mtrying to run it from NetBeans 13 in TomEE using the debugger, but the 
Runbutton is disabled, and there’s no Run section in the project properties 
window.    But, thisworks: I set up my TomEE server in NetBeans. I made a new 
"Java with Gradle"“Web Application” project in NetBeans 13 and choose my TomEE 
server. I canclick the Run button and it starts TomEE and deploys the app. This 
“Java withGradle” project has a Run section in the project properties window. 
So, I thinkNetBeans and TomEE and the rest of my environment is ok. One 
difference is thatthis builds a war file and MyApp builds an ear file.    
NetBeans 13can open the MyApp folder and it finds the root Gradle project and 
the MyApp-warsub project. NetBeans seems to recognize all the Gradle pieces 
correctly, andrunning the gradle build task will build the ear file correctly.  
  Whydoesn't NetBeans let me run MyApp in TomEE? Is it because my root project 
is anear, and NetBeans simply can't run ear files?   
  
  
-----------------------------  MyApp projectfile structure:  
-----------------------------    MyApp  |-- gradle/*  |-- build.gradle  |-- 
gradlew  |-- gradlew.bat  |-- settings.gradle  |-- src      |-- main         
|-- resources              |-- META-INF                  |-- application.xml  
|-- MyApp-war      |-- gradle/*      |-- build.gradle      |-- gradlew      |-- 
gradlew.bat      |-- src          |-- main             |-- webapp
                |-- test.jsp                 |-- WEB-INF                     
|-- web.xml       ----------------------  MyAppsettings.gradle:  
----------------------    rootProject.name= "MyApp"  include'MyApp-war'        
-------------------  MyAppbuild.gradle:  -------------------    plugins {      
id 'ear' }  repositories{      mavenCentral()  }  dependencies{      deploy 
project(path: ':MyApp-war',configuration:'archives')  }  ear {      
appDirectory = file('src/main/resources')  }        -----------------------  
MyApp-warbuild.gradle:  -----------------------    plugins {      id 'java'     
id 'war' }  repositories{      mavenCentral()  }  dependencies{  }       

Reply via email to