Gradle-grails-plugin-2.0.0-snapshot : jar file empty

Hi

I am working on a multi module grails project and using gradle-grails-plugin-2.0.0-snapshot Main project [A] . it depends on grails plugin [b] and [c]

When I try to do a gradle build or gradle assemble, it creates the build folder in [A] and [b] and [C] and puts a jar file. If i open the jar file, it is empty. Can you please help me on how to resolve this/

Thanks Smurfs

I’ll need more detail. If you can share your buildscripts it would be helpful.

Hi Luke,

I have resolved that issue. But, I have got one more issue:

Consider a Multi module Project :

MainProject which has build.gradle and settings

–> finance is just a folder which has two grails project

–> domain --> grails project which has build.gradle

–> core --> grails project which has build.gradle

In the settings, i have the following code:

include ‘:finance:domain’, ‘:finance:core’

In the subprojects of build.gradle of MainProject, i tried to add the following code:

“grails-package-plugin” {

if (project.hasProperty(“args”)) {

args = “–binary”

} } uploadArchives {

repositories.mavenDeployer {

repository(url: “http://localhost:8085/nexus/content/repositories/test/xms”) {

authentication(userName: “admin”, password: “admin123”)

} } }

it is throwing error as it cannot find finance.jar, but I do not need a jar for that folder. Also, i cannot add “grails-package-plugin” in the main project.

Can you please help me on that.

Thanks Smurf

what are you wanting to happen? Do you just want to publish the war file? Or do you want to publish the plugin jars?

I want to publish the jars[core and domain that are under finance folder] and wars to nexus through jenkins.

MainProject which has build.gradle and settings

–> finance is just a folder which has the following two grails plugin project

–> domain --> grails plugin project which has build.gradle

–> core --> grails plugin project which has build.gradle -->App -->grails project that is dependant on finance/domain and finance/core and create a war.

Smurf

It sounds like you are applying the java plugin to the grails plugin projects, is this right?

the app.war will have dependant jars to core.jar and domain.jar.

If i create the project structure asbelow, then it works fine.

MainProject

->domain

->core

->App

I i create few plugins under a folder as below and put some generic tasks in the mainprojects build.gradle, i think, it tries to apply that to each and every project underneath and that causes issue.

MainProject

->domain

->finance/core

->finance/App

“grails-package-plugin” {

if (project.hasProperty(“args”)) {

args = “–binary”

}

}

uploadArchives {

repositories.mavenDeployer {

repository(url: “http://localhost:8085/nexus/content/r…”) {

authentication(userName: “admin”, password: “admin123”)

}

}

} Can you please clarify.

It’s impossible to say based on the information given.

What’s your complete top level build.gradle. Please share it via GitHub Gist.

Build.gradle ========== allprojects {

apply plugin: ‘java’

apply plugin: ‘maven’

apply plugin: ‘base’ }

subprojects {

repositories {

mavenCentral()

}

dependencies {

compile “javax.servlet:servlet-api:2.5”

}

task install1(type: Upload){

configuration = configurations.archives

repositories{

mavenInstaller()

} }

uploadArchives {

repositories.mavenDeployer {

repository(url: “http://localhost:8085/nexus/content/repositories/test”) {

authentication(userName: “admin”, password: “admin123”)

} } }

“grails-package-plugin” {

if (project.hasProperty(“args”)) {

args = “–binary”

} } }

settings.xml ========== include ‘:finance:domain’, ‘:finance:core’ , ‘:app’