jeffwils / grails-spring-security-saml

Grails Spring Security SAML2.0 Plugin for Grails 3
8 stars 24 forks source link

Wont build if a newer version of gradle installed on machine #18

Closed irstevenson closed 6 years ago

irstevenson commented 6 years ago

Attempting to build/install on a Debian machine with gradle 4.5.1 installed (via sdkman) results in the following:

$ grails install

> Configure project : 
The plugin id 'spring-boot' is deprecated. Please use 'org.springframework.boot' instead.

[buildinfo] Not using buildInfo properties file for this build.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'mavenLocal'
   > Invalid publication 'maven': artifact file does not exist: '/home/irstevenson/projects/grails-spring-security-saml/build/classes/java/main/META-INF/grails-plugin.xml'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s
12 actionable tasks: 2 executed, 10 up-to-date
| Error Gradle build terminated with error: Invalid publication 'maven': artifact file does not exist: '/home/irstevenson/projects/grails-spring-security-saml/build/classes/java/main/META-INF/grails-plugin.xml' (Use --stacktrace to see the full trace)

I've attempted all kinds of wierd things, including basics like:

$ gradle --stop
$ sdk use gradle 3.5

But somehow it keeps finding I have 4.5.1 on my machine and so spawns a daemon for it and bang.

Now this is probably more of a grails concern, however it seems to only impact this project because of the publishing plugin. So is it a bug, not sure. Maybe just be wary.

I have another machine with gradle 3.5 on it where things work, so I'll have to continue on there tomorrow.

valentingoebel commented 6 years ago

Copying the file 'build/classes/main/META-INF/grails-plugin.xml' manually to 'build/classes/java/main/META-INF/grails-plugin.xml' makes the build work again.

The culprit is here:

https://github.com/grails/grails-core/blob/bb6a598c3bd513abe825643544e223effe3fe801/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsCentralPublishGradlePlugin.groovy#L401

Adding this line to build.gradle fixes this issue:

sourceSets.main.output.classesDir = 'build/classes/groovy/main'

However classesDir is deprecated see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSetOutput.html#N191E3 so this solution will not work when gradle 5 comes out.

irstevenson commented 6 years ago

Hmmm, an interesting one. Because as mentioned over in PR #20 , even if you add the gradle wrapper to the project grails itself ignores it.

Plus I've seen some issues raised saying grails is having issues with gradle 5.0. So maybe it's a case of 'wait and see' for this code base, and maybe make a note in the README.md for building.

valentingoebel commented 6 years ago

By the way you can use gradle directly.

./gradlew install ./grailsw install These commands will install the plugin, the only difference is which gradle version is used.

irstevenson commented 6 years ago

Merged in #20 , so will close this off - as that's really all that can be done from this end.

irstevenson commented 6 years ago

Cool, looks like they've fixed it:

Coming soon.