Greetings,
I am trying to build my app.ear as below
app.ear
+ META-INF/application.xml
+app.jar
+app2.war
+lib/*.jars
app.jar is built in the same project which contains jpa code and session beans
app2.war is built in a different project
my gradle.build file is below.
apply plugin: 'ear'
apply plugin: 'java'
// base name for the .jar files that are produced
archivesBaseName = 'app'
project.ear.baseName = 'app'
repositories {
//for spring-test third party jar.
maven {
url "${artifactory_contextUrl}/repo1-cache/"
}
}
// for publishing artifacts - right now this really only supports publishing to a local Maven repository
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.mycomp.app'
artifactId 'app-persistence'
version '1.0.0'
from components.java
}
}
}
dependencies {
compile(group: 'org.eclipse.persistence', name: 'eclipselink', version: '2.4.2')
compile(group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.0.0')
compile(group: 'javax.validation', name: 'validation-api', version: '1.1.0.Final')
compile(group: 'javax.transaction', name: 'javax.transaction-api', version: '1.2')
compile(group: 'org.glassfish.main.ejb', name: 'javax.ejb', version: '3.1.2.1')
compile(group: 'com.oracle', name:'ojdbc7', version: '12.1.0.1')
earlib project(path:':app', configuration:'compile')
compile project(":osef")
}
// Findbugs configuration
findbugs {
sourceSets = [sourceSets.main]
}
jar() {
archiveName = "${archivesBaseName}.jar"
}
ear {
appDirName 'src/main' // use application metadata found in this folder
libDirName 'lib'
lib {
from fileTree('earLibs')
}
from('../connectors/directory/build/libs') {
into '/'
}
from('build/lib/${archiveBaseName}.jar') {
into '/'
}
ear.dependsOn = [jar]
archiveName = "${project.ear.baseName}.ear"
}
When I build I don’t see app.jar in the root of app.ear. In addition I see com.mycomp.app.*.class in the root.
Please let me know how to fix the above ?