Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with Grails 2.2.x #46

Closed
BGordts opened this issue Mar 8, 2014 · 10 comments
Closed

Compilation error with Grails 2.2.x #46

BGordts opened this issue Mar 8, 2014 · 10 comments
Assignees
Milestone

Comments

@BGordts
Copy link

BGordts commented Mar 8, 2014

Can't compile this plugin. First had the other pac4j problem (#14), but now I get this error:

| Compiling 212 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java
.lang.NoClassDefFoundError: org/pac4j/core/client/BaseClient (Use --stacktrace t
o see the full trace)

Using grails 2.2.3. Tried cleaning .grails folder. Started with empty project.

Adding compile 'org.pac4j:pac4j-core:1.5.0-SNAPSHOT' in the buildconfig dependency block resolves the problem.

@alvarosanchez
Copy link
Member

Which version of the plugin are you using? Can I see BuildConfig.groovy?

@hgarfer
Copy link

hgarfer commented Mar 19, 2014

same problem here, thanks for your solution @BGordts

@alvarosanchez, here is my BuildConfig, I am using Grails 2.2.5

   repositories {
        inherits true // Whether to inherit repository definitions from plugins

        grailsPlugins()
        grailsHome()
        grailsCentral()

        mavenLocal()
        mavenCentral()

        mavenRepo "http://repo.spring.io/milestone/"
        mavenRepo "https://oss.sonatype.org/content/repositories/snapshots"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.

        runtime 'mysql:mysql-connector-java:5.1.22'
    }

    plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":database-migration:1.3.8"

        runtime ":jquery:1.8.3"
        runtime ":resources:1.2.6"
        compile ':lesscss-resources:1.3.0.3'
        compile ':cache:1.1.1'
        compile ':kickstart-with-bootstrap:0.8.9'
        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
        //runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.5"

        compile ":spring-security-core:2.0-RC2"        
        compile ":spring-security-rest:1.3.1", {
            excludes: 'spring-security-core'
        }

        build ":tomcat:$grailsVersion"

        compile ":gson:1.1.4"

    }
}

@mugdho
Copy link

mugdho commented Mar 20, 2014

I added pac4j-core as a dependency as below and this error goes way. It doesn't look like this was being pulled from the repo.

compile 'org.pac4j:pac4j-core:1.4.1'

@BGordts
Copy link
Author

BGordts commented Mar 21, 2014

Sorry @alvarosanchez for not replying, didn't notice the comments that were posted here...

@alvarosanchez alvarosanchez changed the title Compilation error: pac4j Compilation error with Grails 2.2.x Mar 24, 2014
@alvarosanchez
Copy link
Member

I suspect this is something happening in Grails 2.2 but not in 2.3. Will take a look at it.

@ptrd
Copy link

ptrd commented Apr 18, 2014

Same with grails 2.3.6 and plugin version 1.3.3:
"error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/pac4j/core/client/BaseClient"

I guess the right pac4j version to use is 1.5.0, right?

For others that run into the same trouble: make sure you add the dependency in the "dependencies { }" clause, not in the "plugins { ... }" section

@alvarosanchez
Copy link
Member

From version 1.3.3 onwards, neither pac4 nor its repo needs to be defined explicitly.

@jtduffy
Copy link

jtduffy commented May 1, 2014

Hello Álvaro,

I just recently completed an upgrade to Grails Spring Security plugin version 2.0, and then added your REST API plugin. Unfortunately, I'm running into the same error discussed at the beginning of this issue: Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/pac4j/core/client/BaseClient

I have tried with and without the pac4 dependency explicitly defined, and I also tried to exclude "spring-security-core" from the compile ":spring-security-rest:1.3.4" plugin statement. I have not added any other repositories except for "repo.spring.io/milestone/". In addition, I've removed my org.grails.plugins folder under .grails and .m2.

I'm running Grails 2.3.4. This is the relevant part of my BuildConfig plugin closure:

compile ":spring-security-core:2.0-RC2"
compile ":spring-security-ldap:2.0-RC2"
compile ":spring-security-rest:1.3.4"

I assume it must be something simple I'm overlooking, but I can't seem to figure it out. Any ideas? By the way, the plugin looks fantastic, and fills a need I have perfectly.

Thanks.

EDIT -- I added the sonatype maven repo and explicitly added the pac4j-core:1.5.0 dependency and everything seems to be in order now.

@dmahapatro
Copy link

@jtduffy I didn't see you already did what I commented. Glad it worked out but as @alvarosanchez mentioned, explicit dependency is not required post 1.3.3.

@alvarosanchez alvarosanchez added this to the 1.4.0.M1 milestone May 29, 2014
@alvarosanchez
Copy link
Member

1.4.0.M1 should fix this issue. Can you please try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants