java ee - Importing Ear project generated by gradle in eclipse -
i using gradle set multi-project build. have following folder layout projects:
---rootproject ---- build.gradle ---- settings.gradle ------ jarproject (utility) --------- build.gradle ------ jpaproject (dependency on jarproject) --------- build.gradle ------ ejbproject (dependency on jarproject, jpaproject) --------- build.gradle ------ webproject (dependency on ejbproject) --------- build.gradle
tools & technologies
- gradle: 1.6
- java: 1.7
- eclipse: juno
- server: glassfish 3.1.2.2
i able define multi-project build above folder layout. gradle able generate eclipse meta-data each of project able import projects in eclipse. gradle able correctly generate ".ear" artifact. however, unable deploy ear project eclipse. during deployment eclipse gives nullpointerexception.
in order tell gradle generate appropriate facet earproject, ejbproject , jpaproject, have added following code: * earproject/build.gradle
apply plugin: 'ear' apply plugin: 'eclipse-wtp' eclipse { wtp { facet { facet name:'jst.ear', version:'6.0' } } }
* ejbproject/build.gradle
apply plugin: 'war' apply plugin: 'eclipse-wtp' eclipse { wtp { facet { facet name:'jst.ejb', version:'3.1' } } }
jpaproject/build.gradle
apply plugin: 'war' apply plugin: 'eclipse-wtp' eclipse { wtp { facet { facet name:'java', version:'1.6' facet name:'jpt.jpa', version:'2.0' } } }
webproject/build.gradle
apply plugin: 'war' apply plugin: 'eclipse-wtp' eclipse { wtp { facet { facet name:'java', version:'1.6' facet name:'jst.web', version:'3.0' facet name:'wst.jsdt.web', version:'1.0' } } }
notice though ejbproject , jpaproject not web projects, plugin 'war' applied. because of gradle thinks ejbproject , jpaproject web projects , creates eclipse meta data accordingly.
for ejbproject/jpaproject, file "org.eclipse.wst.common.component" has following content
<property name="context-root" value="prj-context"/>
<wb-resource deploy-path="/web-inf/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/web-inf/classes" source-path="src/main/java"/>
due this, when export ejbproject/jpaproject ejb-jar or jar file, eclipse not create correct jar file.
another issue unable export earproject ".ear" file using eclipse "file->export->ear file". exception
when try deploy earproject within eclipse, gives nullpointerexception.
my idea deploy earproject within eclipse glassfish server defined in eclipse , debug application.
please give me guidance.
tia chir
Comments
Post a Comment