Quantcast

Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

phillipuniverse
I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a version of it on Grails central which you can see here: http://grails.org/plugin/broadleaf.  However, I've come across a pretty weird problem when I try to actually use the plugin.  It doesn't seem that the maven repository that I have declared in the plugin is getting inherited by my test application.

The BuildConfig.groovy for my test application is exactly what gets built from 'grails create-app grails-test', with the inclusion of the broadleaf plugin:

     grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
// uncomment these to enable remote dependency resolution from public Maven repositories
//mavenCentral()
//mavenLocal()
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// runtime 'mysql:mysql-connector-java:5.1.16'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.6"
compile ":broadleaf:0.3.SNAPSHOT"
// 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.4"
build ":tomcat:$grailsVersion"
}
}

And my plugin BuildConfig.groovy is declared like this:

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.dependency.resolution = {
    // inherit Grails" default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes "ehcache"
    }
    log "warn" // log level of Ivy resolver, either "error", "warn", "info", "debug" or "verbose"
    repositories {
        inherits true
        grailsPlugins()
        grailsHome()
        grailsCentral()

        // from public Maven repositories
        mavenCentral()
        //mavenLocal()
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
    dependencies {
        // specify dependencies here under either "build", "compile", "runtime", "test" or "provided" scopes eg.
def broadleafVersion = "1.7.0-SNAPSHOT"
def springVersion = "3.1.0.RELEASE"
def excludes = {
excludes "slf4j-simple", "persistence-api", "commons-logging", "jcl-over-slf4j", "slf4j-api", "jta", "xmlbeans"
excludes "spring-core", "spring-beans", "spring-aop", "spring-asm","spring-webmvc","spring-tx"
excludes "spring-context", "spring-web", "spring-parent", "spring-jdbc"
excludes "log4j", "slf4j-log4j12"
excludes group:"org.grails", name:"grails-core"
excludes group:"org.grails", name:"grails-gorm"
excludes group:"org.grails", name:"grails-test"
excludes group:"xml-apis", name:"xml-apis"
excludes "ehcache-core"
excludes "jsr173_api", "stax-api"
}
compile (
[group: "org.broadleafcommerce", name: "broadleaf-common", version: "${broadleafVersion}"],
[group: "org.broadleafcommerce", name: "broadleaf-admin-module", version: "${broadleafVersion}"], 
[group: "org.broadleafcommerce", name: "broadleaf-profile", version: "${broadleafVersion}"],
[group: "org.broadleafcommerce", name: "broadleaf-contentmanagement-module", version: "${broadleafVersion}"],
[group: "org.broadleafcommerce", name: "broadleaf-open-admin-platform", version: "${broadleafVersion}"],
[group: "org.hibernate", name: "hibernate-entitymanager", version: "3.6.8.Final"],
[group: "org.apache.velocity", name: "velocity-tools", version: "2.0"],
[group: "org.apache.velocity", name: "velocity", version: "1.6.2"],
[group: "javax.mail", name: "mail", version: "1.4.1"],
//Need Spring security. Is it better to use a manual dependency or a Grails plugin?
//Let"s go with manual dependency for now...
[group: "org.springframework.security", name: "spring-security-acl", version: "${springVersion}"],
[group: "org.springframework.security", name: "spring-security-core", version: "${springVersion}"],
[group: "org.springframework.security", name: "spring-security-web", version: "${springVersion}"],
[group: "org.springframework.security", name: "spring-security-taglibs", version: "${springVersion}"],
[group: "org.springframework.security", name: "spring-security-config", version: "${springVersion}"],
excludes
)  
        // runtime "mysql:mysql-connector-java:5.1.5"
    }

    plugins {
   compile ":hibernate-jpa-provider:1.0.0.M1"
    compile ":gorm-jpa:1.0.0.M1" 
        build(":release:2.0.0") {
            export = false
        }
    }
}

As you can see, the plugin declares a custom maven repository: http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/.  However, when I try doing 'grails run-app' from my application, I get the following errror:

~/broadleaf/grails-test » grails run-app                                                                                                                            
| Configuring classpath
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):

- org.broadleafcommerce:broadleaf-profile:1.7.0-SNAPSHOT
- org.broadleafcommerce:broadleaf-admin-module:1.7.0-SNAPSHOT
- org.broadleafcommerce:broadleaf-common:1.7.0-SNAPSHOT
- org.broadleafcommerce:broadleaf-open-admin-platform:1.7.0-SNAPSHOT
- org.broadleafcommerce:broadleaf-contentmanagement-module:1.7.0-SNAPSHOT

All of these dependencies are clearly in the repository.  In the plugin directory, 'grails package-plugin' works with no problems.  Also, in the test application, when remove the plugin declaration at the bottom and instead declare the Broadleaf plugin with:

grails.plugin.location.broadleaf = "/path/to/plugin"

Everything works exactly as I expect and the artifacts are resolved no problem.  Anybody else run into something like this?

-- 
Phillip Verheyden
Broadleaf Commerce
<a href="applewebdata://713A0CD6-5287-415F-8B1E-C781FC7C8311/www.broadleafcommerce.org">www.broadleafcommerce.org

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

Graeme Rocher
Administrator
Could you post to the user list in future?

Anyway the reason this is because Ivy doesn't support repositories
declared in a POM and the POM is published with all of the
dependencies in it.

It is up to the user to declare the necessary repositories in the
application itself. This is why we started publishing the needed
repository info on this plugin portal:

http://grails.org/plugin/broadleaf

Cheers

On Tue, May 8, 2012 at 6:21 PM, Phillip Verheyden
<[hidden email]> wrote:

> I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a
> version of it on Grails central which you can see
> here: http://grails.org/plugin/broadleaf.  However, I've come across a
> pretty weird problem when I try to actually use the plugin.  It doesn't seem
> that the maven repository that I have declared in the plugin is getting
> inherited by my test application.
>
> The BuildConfig.groovy for my test application is exactly what gets built
> from 'grails create-app grails-test', with the inclusion of the broadleaf
> plugin:
>
>      grails.servlet.version = "2.5" // Change depending on target container
> compliance (2.5 or 3.0)
>
> grails.project.class.dir = "target/classes"
> grails.project.test.class.dir = "target/test-classes"
> grails.project.test.reports.dir = "target/test-reports"
> grails.project.target.level = 1.6
> grails.project.source.level = 1.6
> //grails.project.war.file = "target/${appName}-${appVersion}.war"
> grails.project.dependency.resolution = {
> // inherit Grails' default dependencies
> inherits("global") {
> // uncomment to disable ehcache
> // excludes 'ehcache'
> }
> log "error" // log level of Ivy resolver, either 'error', 'warn', 'info',
> 'debug' or 'verbose'
> checksums true // Whether to verify checksums on resolve
> repositories {
> inherits true // Whether to inherit repository definitions from plugins
> grailsPlugins()
> grailsHome()
> grailsCentral()
> mavenCentral()
> // uncomment these to enable remote dependency resolution from public Maven
> repositories
> //mavenCentral()
> //mavenLocal()
> //mavenRepo "http://snapshots.repository.codehaus.org"
> //mavenRepo "http://repository.codehaus.org"
> //mavenRepo "http://download.java.net/maven/2/"
> //mavenRepo "http://repository.jboss.com/maven2/"
> }
> dependencies {
> // specify dependencies here under either 'build', 'compile', 'runtime',
> 'test' or 'provided' scopes eg.
> // runtime 'mysql:mysql-connector-java:5.1.16'
> }
> plugins {
> runtime ":hibernate:$grailsVersion"
> runtime ":jquery:1.7.1"
> runtime ":resources:1.1.6"
> compile ":broadleaf:0.3.SNAPSHOT"
> // 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.4"
> build ":tomcat:$grailsVersion"
> }
> }
>
>
> And my plugin BuildConfig.groovy is declared like this:
>
> grails.project.class.dir = "target/classes"
> grails.project.test.class.dir = "target/test-classes"
> grails.project.test.reports.dir = "target/test-reports"
> grails.project.target.level = 1.6
> //grails.project.war.file = "target/${appName}-${appVersion}.war"
>
> grails.project.dependency.resolution = {
>     // inherit Grails" default dependencies
>     inherits("global") {
>         // uncomment to disable ehcache
>         // excludes "ehcache"
>     }
>     log "warn" // log level of Ivy resolver, either "error", "warn", "info",
> "debug" or "verbose"
>     repositories {
>         inherits true
>         grailsPlugins()
>         grailsHome()
>         grailsCentral()
>
>         // from public Maven repositories
>         mavenCentral()
>         //mavenLocal()
>     mavenRepo
> "http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/"
>         mavenRepo "http://www.terracotta.org/download/reflector/releases"
>         //mavenRepo "http://snapshots.repository.codehaus.org"
>         //mavenRepo "http://repository.codehaus.org"
>         //mavenRepo "http://download.java.net/maven/2/"
>         //mavenRepo "http://repository.jboss.com/maven2/"
>     }
>     dependencies {
>         // specify dependencies here under either "build", "compile",
> "runtime", "test" or "provided" scopes eg.
>
> def broadleafVersion = "1.7.0-SNAPSHOT"
>
> def springVersion = "3.1.0.RELEASE"
>
> def excludes = {
>
> excludes "slf4j-simple", "persistence-api", "commons-logging",
> "jcl-over-slf4j", "slf4j-api", "jta", "xmlbeans"
>
> excludes "spring-core", "spring-beans", "spring-aop",
> "spring-asm","spring-webmvc","spring-tx"
>
> excludes "spring-context", "spring-web", "spring-parent", "spring-jdbc"
>
> excludes "log4j", "slf4j-log4j12"
>
> excludes group:"org.grails", name:"grails-core"
>
> excludes group:"org.grails", name:"grails-gorm"
>
> excludes group:"org.grails", name:"grails-test"
>
> excludes group:"xml-apis", name:"xml-apis"
>
> excludes "ehcache-core"
>
> excludes "jsr173_api", "stax-api"
>
> }
>
> compile (
>
> [group: "org.broadleafcommerce", name: "broadleaf-common", version:
> "${broadleafVersion}"],
>
> [group: "org.broadleafcommerce", name: "broadleaf-admin-module", version:
> "${broadleafVersion}"],
>
> [group: "org.broadleafcommerce", name: "broadleaf-profile", version:
> "${broadleafVersion}"],
>
> [group: "org.broadleafcommerce", name: "broadleaf-contentmanagement-module",
> version: "${broadleafVersion}"],
>
> [group: "org.broadleafcommerce", name: "broadleaf-open-admin-platform",
> version: "${broadleafVersion}"],
>
> [group: "org.hibernate", name: "hibernate-entitymanager", version:
> "3.6.8.Final"],
>
> [group: "org.apache.velocity", name: "velocity-tools", version: "2.0"],
>
> [group: "org.apache.velocity", name: "velocity", version: "1.6.2"],
>
> [group: "javax.mail", name: "mail", version: "1.4.1"],
>
> //Need Spring security. Is it better to use a manual dependency or a Grails
> plugin?
>
> //Let"s go with manual dependency for now...
>
> [group: "org.springframework.security", name: "spring-security-acl",
> version: "${springVersion}"],
>
> [group: "org.springframework.security", name: "spring-security-core",
> version: "${springVersion}"],
>
> [group: "org.springframework.security", name: "spring-security-web",
> version: "${springVersion}"],
>
> [group: "org.springframework.security", name: "spring-security-taglibs",
> version: "${springVersion}"],
>
> [group: "org.springframework.security", name: "spring-security-config",
> version: "${springVersion}"],
>
> excludes
>
> )
>
>         // runtime "mysql:mysql-connector-java:5.1.5"
>     }
>
>     plugins {
>    compile ":hibernate-jpa-provider:1.0.0.M1"
>     compile ":gorm-jpa:1.0.0.M1"
>         build(":release:2.0.0") {
>             export = false
>         }
>     }
> }
>
>
> As you can see, the plugin declares a custom maven
> repository: http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/.
>  However, when I try doing 'grails run-app' from my application, I get the
> following errror:
>
> ~/broadleaf/grails-test » grails run-app
>
>
> | Configuring classpath
> | Error Failed to resolve dependencies (Set log level to 'warn' in
> BuildConfig.groovy for more information):
>
> - org.broadleafcommerce:broadleaf-profile:1.7.0-SNAPSHOT
> - org.broadleafcommerce:broadleaf-admin-module:1.7.0-SNAPSHOT
> - org.broadleafcommerce:broadleaf-common:1.7.0-SNAPSHOT
> - org.broadleafcommerce:broadleaf-open-admin-platform:1.7.0-SNAPSHOT
> - org.broadleafcommerce:broadleaf-contentmanagement-module:1.7.0-SNAPSHOT
>
>
> All of these dependencies are clearly in the repository.  In the plugin
> directory, 'grails package-plugin' works with no problems.  Also, in the
> test application, when remove the plugin declaration at the bottom and
> instead declare the Broadleaf plugin with:
>
> grails.plugin.location.broadleaf = "/path/to/plugin"
>
> Everything works exactly as I expect and the artifacts are resolved no
> problem.  Anybody else run into something like this?
>
> --
> Phillip Verheyden
> Broadleaf Commerce
> www.broadleafcommerce.org
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

pledbrook
In reply to this post by phillipuniverse
> I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a
> version of it on Grails central which you can see
> here: http://grails.org/plugin/broadleaf.  However, I've come across a
> pretty weird problem when I try to actually use the plugin.  It doesn't seem
> that the maven repository that I have declared in the plugin is getting
> inherited by my test application.

We may not be explaining this well enough, but my understanding is
that inheritance of plugin repositories won't work. This is mainly
because Maven repositories should not be declared in POMs. In fact, I
believe that Maven Central will at some point not allow POMs with
repository definitions.

This is why the plugin portal page includes the URLs for the custom
repositories required by the Broadleaf plugin. The expectation is that
users of the plugin will copy and paste those into their projects'
BuildConfig.groovy files.

Hope that helps,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

Nick Vaidyanathan
"It is up to the user to declare the necessary repositories in the application itself. "
"The expectation is that users of the plugin will copy and paste those into their projects' BuildConfig.groovy files."

Whoa whoa whoa. Does this imply that users of plugins that use custom maven repositories are expected to open the plugin source and manually append them to their mavenRepos? Or is there something special about Broadleaf that makes this necessary?

If that's the case globally, this sounds like a Grails bug. The point of plugins, to me (I may be wrong), has always been to provide a COTS solution. Viewing plugin source has always been educational and a thing to do when looking for bugs, but never required. This seems like it makes it required...well, in certain circumstances (when alternate maven repos are used) and not others.

Which means, to me, that the prudent thing to do would be to always look at the plugin source for every plugin you use. Not the most convenient "feature." Can we get further details on what these statements mean? 

On Wed, May 9, 2012 at 3:01 AM, Peter Ledbrook <[hidden email]> wrote:
> I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a
> version of it on Grails central which you can see
> here: http://grails.org/plugin/broadleaf.  However, I've come across a
> pretty weird problem when I try to actually use the plugin.  It doesn't seem
> that the maven repository that I have declared in the plugin is getting
> inherited by my test application.

We may not be explaining this well enough, but my understanding is
that inheritance of plugin repositories won't work. This is mainly
because Maven repositories should not be declared in POMs. In fact, I
believe that Maven Central will at some point not allow POMs with
repository definitions.

This is why the plugin portal page includes the URLs for the custom
repositories required by the Broadleaf plugin. The expectation is that
users of the plugin will copy and paste those into their projects'
BuildConfig.groovy files.

Hope that helps,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

rlovtangen
In reply to this post by pledbrook

On May 9, 2012, at 12:01 PM, Peter Ledbrook wrote:

>> I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a
>> version of it on Grails central which you can see
>> here: http://grails.org/plugin/broadleaf.  However, I've come across a
>> pretty weird problem when I try to actually use the plugin.  It doesn't seem
>> that the maven repository that I have declared in the plugin is getting
>> inherited by my test application.
>
> We may not be explaining this well enough, but my understanding is
> that inheritance of plugin repositories won't work. This is mainly
> because Maven repositories should not be declared in POMs. In fact, I
> believe that Maven Central will at some point not allow POMs with
> repository definitions.

This has been working up to now, is something about to change?
E.g. grails-melody plugin (up to version 1.12)  adds maven repo http://maven.glassfish.org/content/groups/public/ used for downloading jrobin.
Other plugins who pulls in maven repositories includes spring-security-ui, springcache, app-info etc.


>
> This is why the plugin portal page includes the URLs for the custom
> repositories required by the Broadleaf plugin. The expectation is that
> users of the plugin will copy and paste those into their projects'
> BuildConfig.groovy files.
>
> Hope that helps,
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

Graeme Rocher
Administrator
In reply to this post by Nick Vaidyanathan
On Wed, May 9, 2012 at 8:09 PM, Lead Visionary
<[hidden email]> wrote:

> "It is up to the user to declare the necessary repositories in
> the application itself. "
> "The expectation is that users of the plugin will copy and paste those into
> their projects' BuildConfig.groovy files."
>
> Whoa whoa whoa. Does this imply that users of plugins that use custom maven
> repositories are expected to open the plugin source and manually append them
> to their mavenRepos? Or is there something special about Broadleaf that
> makes this necessary?
>
> If that's the case globally, this sounds like a Grails bug. The point of
> plugins, to me (I may be wrong), has always been to provide a COTS solution.
> Viewing plugin source has always been educational and a thing to do when
> looking for bugs, but never required. This seems like it makes it
> required...well, in certain circumstances (when alternate maven repos are
> used) and not others.
>
> Which means, to me, that the prudent thing to do would be to always look at
> the plugin source for every plugin you use. Not the most convenient
> "feature." Can we get further details on what these statements mean?


It shouldn't be required to look at the source, but may be required to
look at the plugin portal page for a plugin.

This wasn't required before because we never published valid POMs for
plugins. We now do publish valid POMs, this is a good thing because
dependency eviction and exclusions will work properly as they never
did before. Transitive jars will also only require a single resolve
instead of multiple slower resolves.

The downside is that Ivy doesn't support repositories defined in POMs,
hence this new requirement. There isn't really anything we can do
about it unfortunately. However if it is a frequently used dependency
for a popular plugin we can configure the repository as a remote of
http://repo.grails.org/grails/core/

Thus allowing it to be resolved by Grails without additional configuration

Cheers


>
>
> On Wed, May 9, 2012 at 3:01 AM, Peter Ledbrook <[hidden email]>
> wrote:
>>
>> > I'm working on developing a Broadleaf plugin for Grails.  We've uploaded
>> > a
>> > version of it on Grails central which you can see
>> > here: http://grails.org/plugin/broadleaf.  However, I've come across a
>> > pretty weird problem when I try to actually use the plugin.  It doesn't
>> > seem
>> > that the maven repository that I have declared in the plugin is getting
>> > inherited by my test application.
>>
>> We may not be explaining this well enough, but my understanding is
>> that inheritance of plugin repositories won't work. This is mainly
>> because Maven repositories should not be declared in POMs. In fact, I
>> believe that Maven Central will at some point not allow POMs with
>> repository definitions.
>>
>> This is why the plugin portal page includes the URLs for the custom
>> repositories required by the Broadleaf plugin. The expectation is that
>> users of the plugin will copy and paste those into their projects'
>> BuildConfig.groovy files.
>>
>> Hope that helps,
>>
>> Peter
>>
>> --
>> Peter Ledbrook
>> Grails Advocate
>> SpringSource - A Division of VMware
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

pledbrook
In reply to this post by Nick Vaidyanathan
> "It is up to the user to declare the necessary repositories in
> the application itself. "
> "The expectation is that users of the plugin will copy and paste those into
> their projects' BuildConfig.groovy files."
>
> Whoa whoa whoa. Does this imply that users of plugins that use custom maven
> repositories are expected to open the plugin source and manually append them
> to their mavenRepos? Or is there something special about Broadleaf that
> makes this necessary?

No. The custom repository definitions need to be added to the
application's BuildConfig.groovy, not the plugin's. There's no real
way round this for the reasons Graeme and I mentioned.

Hope that helps,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

Erik Pragt-3
In reply to this post by pledbrook
On Wed, May 9, 2012 at 12:01 PM, Peter Ledbrook <[hidden email]> wrote:

>> I'm working on developing a Broadleaf plugin for Grails.  We've uploaded a
>> version of it on Grails central which you can see
>> here: http://grails.org/plugin/broadleaf.  However, I've come across a
>> pretty weird problem when I try to actually use the plugin.  It doesn't seem
>> that the maven repository that I have declared in the plugin is getting
>> inherited by my test application.
>
> We may not be explaining this well enough, but my understanding is
> that inheritance of plugin repositories won't work. This is mainly
> because Maven repositories should not be declared in POMs. In fact, I
> believe that Maven Central will at some point not allow POMs with
> repository definitions.
>
> This is why the plugin portal page includes the URLs for the custom
> repositories required by the Broadleaf plugin. The expectation is that
> users of the plugin will copy and paste those into their projects'
> BuildConfig.groovy files.

Hi Peter,

I hope your understanding here is incorrect. It would be a pity to
have to copy those maven repos, creating a sort of duplication between
the plugin and the project. In our Fitnesse plugin, we use a custom
repository, but I hope people don't have to been greeted by a 'cannot
find dependency XXX' message to start investigating that they have to
copy some Maven repositories. Not really friendly to the enduser, I'd
say.

Erik

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

phillipuniverse
In reply to this post by pledbrook
Thanks everyone for the discussion and answers.

-- 
Phillip Verheyden
Broadleaf Commerce
<a href="applewebdata://713A0CD6-5287-415F-8B1E-C781FC7C8311/www.broadleafcommerce.org">www.broadleafcommerce.org

On May 10, 2012, at 3:25 AM, Peter Ledbrook wrote:

"It is up to the user to declare the necessary repositories in
the application itself. "
"The expectation is that users of the plugin will copy and paste those into
their projects' BuildConfig.groovy files."

Whoa whoa whoa. Does this imply that users of plugins that use custom maven
repositories are expected to open the plugin source and manually append them
to their mavenRepos? Or is there something special about Broadleaf that
makes this necessary?

No. The custom repository definitions need to be added to the
application's BuildConfig.groovy, not the plugin's. There's no real
way round this for the reasons Graeme and I mentioned.

Hope that helps,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

pledbrook
In reply to this post by Erik Pragt-3
> I hope your understanding here is incorrect. It would be a pity to
> have to copy those maven repos, creating a sort of duplication between
> the plugin and the project. In our Fitnesse plugin, we use a custom
> repository, but I hope people don't have to been greeted by a 'cannot
> find dependency XXX' message to start investigating that they have to
> copy some Maven repositories. Not really friendly to the enduser, I'd
> say.

There is a technical issue here as Graeme mentioned, i.e. Ivy can't
read repositories from POMs. But underlying this issue is a general
move towards not including custom repository URLs with dependency
descriptors:

    http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

Sonatype are definitely moving in this direction and I believe the
Gradle guys agree with them.

I agree it at first glance it doesn't seem friendly to the users, but
we have to recognise the changes happening in this space. In my view,
we should focus on ways to both educate users to this change and
provide automated ways of injecting this information.

I would still love to see a way for YAML files to be imported into
ConfigSlurper, because they are much easier to parse and update
programmatically than ConfigSlurper. I still think this is an approach
we should investigate, but it's a case of finding someone to do that.

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application Not Inheriting Maven Repositories from Plugin Grails 2.0.3

Nick Vaidyanathan
Thanks for the analysis. 

I would still love to see a way for YAML files to be imported into
ConfigSlurper, because they are much easier to parse and update
programmatically than ConfigSlurper. I still think this is an approach
we should investigate, but it's a case of finding someone to do that

Where exactly is this happening in grails-core? 

Is it in assemble.grade? (methinks that is strictly for building grails, but hard to be sure)
Does it use the ResourceLoader?
Would this involve adding a spec to https://github.com/grails/grails-core/blob/master/grails-core/src/test/groovy/org/codehaus/groovy/grails/core/io/ResourceLocatorSpec.groovy to parse YAML? The grep -R ConfigSlurper in the grails-core project on my machine has taken 5 minutes, and I'm not sure she's coming back...

On Fri, May 11, 2012 at 1:47 AM, Peter Ledbrook <[hidden email]> wrote:
> I hope your understanding here is incorrect. It would be a pity to
> have to copy those maven repos, creating a sort of duplication between
> the plugin and the project. In our Fitnesse plugin, we use a custom
> repository, but I hope people don't have to been greeted by a 'cannot
> find dependency XXX' message to start investigating that they have to
> copy some Maven repositories. Not really friendly to the enduser, I'd
> say.

There is a technical issue here as Graeme mentioned, i.e. Ivy can't
read repositories from POMs. But underlying this issue is a general
move towards not including custom repository URLs with dependency
descriptors:

   http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

Sonatype are definitely moving in this direction and I believe the
Gradle guys agree with them.

I agree it at first glance it doesn't seem friendly to the users, but
we have to recognise the changes happening in this space. In my view,
we should focus on ways to both educate users to this change and
provide automated ways of injecting this information.

I would still love to see a way for YAML files to be imported into
ConfigSlurper, because they are much easier to parse and update
programmatically than ConfigSlurper. I still think this is an approach
we should investigate, but it's a case of finding someone to do that.

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Loading...