Grails
  1. Grails
  2. GRAILS-6147

Maven classifier not working for deps

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.2.2
    • Fix Version/s: 2.3-M1
    • Component/s: Configuration
    • Labels:
      None

      Description

      During the Grails executions, run-app, war, etc. I get the following issue, which appears to be an internal Ivy-related issue. Even when executing my project through grails-maven-plugin, there appears to be some resolution on the part of Ivy and it get's mad since it doesn't properly understand the classifier like the following dep:

      <dependency>
      <groupId>net.sf.json-lib</groupId>
      <artifactId>json-lib</artifactId>
      <version>2.3</version>
      <classifier>jdk15</classifier>
      </dependency>

      – ERROR MESSAGE –

      :: problems summary ::
      :::: WARNINGS
      [FAILED ] net.sf.json-lib#json-lib;2.3!json-lib.jar: (0ms)

      ==== grailsPlugins: tried

      /Users/arimus/workspace/mt-api/lib/json-lib-2.3.jar

      /Users/arimus/.grails/1.2.2/projects/mt-api/plugins/hibernate-1.2.2/lib/json-lib-2.3.jar

      /Users/arimus/.grails/1.2.2/projects/mt-api/plugins/jaxrs-0.4/lib/json-lib-2.3.jar

      /Users/arimus/.grails/1.2.2/projects/mt-api/plugins/tomcat-1.2.2/lib/json-lib-2.3.jar

      ==== grailsHome: tried

      /Users/arimus/grails/lib/json-lib-2.3.jar

      ==== grailsHome: tried

      /Users/arimus/grails/dist/json-lib-2.3.jar

      ==== localMavenResolver: tried

      /Users/arimus/.m2/repository/net/sf/json-lib/json-lib/2.3/json-lib-2.3.jar

      ::::::::::::::::::::::::::::::::::::::::::::::

      :: FAILED DOWNLOADS ::

      :: ^ see resolution messages for details ^ ::

      ::::::::::::::::::::::::::::::::::::::::::::::

      :: net.sf.json-lib#json-lib;2.3!json-lib.jar

      ::::::::::::::::::::::::::::::::::::::::::::::

      – WORK AROUND –

      Install json-lib-2.3-jdk15.jar as json-lib-2.3.jar (in M2 repo or by placing in <project>/lib)

        Issue Links

          Activity

          Hide
          Luke Daley added a comment -

          Nicolas, how are you verifying this?

          Show
          Luke Daley added a comment - Nicolas, how are you verifying this?
          Hide
          Nicolas Labrot added a comment -

          I understand better our difference.

          I just retry by cleaning the "net.sourceforge.saxon" ivy cache entry. After the build I have the 3 dependencies in the WAR : OK

          But if I clean "net.sourceforge.saxon" and build with the first dep commented (dep without the classifier) I have the 2 deps with the classifier in the WAR : OK
          If I uncomment the dep and rebuild, the WAR file contains only the 2 deps : NOK.

          I will check this evening the Ivy behaviour.

          Show
          Nicolas Labrot added a comment - I understand better our difference. I just retry by cleaning the "net.sourceforge.saxon" ivy cache entry. After the build I have the 3 dependencies in the WAR : OK But if I clean "net.sourceforge.saxon" and build with the first dep commented (dep without the classifier) I have the 2 deps with the classifier in the WAR : OK If I uncomment the dep and rebuild, the WAR file contains only the 2 deps : NOK. I will check this evening the Ivy behaviour.
          Hide
          Nicolas Labrot added a comment -

          I have test with Ivy 2.2.0 and it works perfectly.

          Scenario 1 (SC1) :

          1. I clean Ivy and Grails cache
          2. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar.
          3. Ivy and Grails output the 2 dependencies with classifier.
          4. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar and saxon-9.1.0.8.jar.
          5. Ivy output the 3 dependencies but Grails output only the 2 dependencies with classifier.

          Scenario 2 (SC2) :

          1. I clean Ivy and Grails cache
          2. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar and saxon-9.1.0.8.jar.
          3. Ivy and Grails output the 3 dependencies.
          4. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar
          5. Ivy and Grails output the 2 dependencies with classifier.

          The difference between SC1 and SC2 may be the file "ivy-cache/net.sourceforge.saxon/saxonivy-9.1.0.8.xml"

          SC1 for Grails

           
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0">
          	<info organisation="net.sourceforge.saxon"
          		module="saxon"
          		revision="9.1.0.8"
          		status="release"
          		publication="20120502202413"
          		default="true"
          		m:classifier="s9api"
          	/>
          	<configurations>
          		<conf name="default" visibility="public"/>
          	</configurations>
          	<publications>
          		<artifact name="saxon" type="jar" ext="jar" conf="default" classifier="s9api"/>
          		<artifact name="saxon" type="jar" ext="jar" conf="default" classifier="dom"/>
          	</publications>
          </ivy-module>
          

          SC1 and SC2 for Ivy and SC2 for Grails

           
          <?xml version="1.0" encoding="UTF-8"?>
          <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
          	<info organisation="net.sourceforge.saxon"
          		module="saxon"
          		revision="9.1.0.8"
          		status="release"
          		publication="20100226065342"
          	>
          		<license name="Mozilla Public License Version 1.0" url="http://www.mozilla.org/MPL/MPL-1.0.txt" />
          		<description homepage="http://saxon.sourceforge.net/">
          		Saxon a complete and conformant implementation of the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations published on 23 January 2007 by W3C
          		</description>
          	</info>
          	<configurations>
          		[...]
          	</configurations>
          	<publications>
          		<artifact name="saxon" type="jar" ext="jar" conf="master"/>
          		<artifact name="saxon" type="source" ext="jar" conf="sources" m:classifier="sources"/>
          		<artifact name="saxon" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
          	</publications>
          </ivy-module>
          

          Hope it will help

          Show
          Nicolas Labrot added a comment - I have test with Ivy 2.2.0 and it works perfectly. Scenario 1 (SC1) : I clean Ivy and Grails cache I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar. Ivy and Grails output the 2 dependencies with classifier. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar and saxon-9.1.0.8.jar. Ivy output the 3 dependencies but Grails output only the 2 dependencies with classifier. Scenario 2 (SC2) : I clean Ivy and Grails cache I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar and saxon-9.1.0.8.jar. Ivy and Grails output the 3 dependencies. I set dependencies as saxon-9.1.0.8-dom.jar and saxon-9.1.0.8-s9api.jar Ivy and Grails output the 2 dependencies with classifier. The difference between SC1 and SC2 may be the file "ivy-cache/net.sourceforge.saxon/saxonivy-9.1.0.8.xml" SC1 for Grails <?xml version= "1.0" encoding= "UTF-8" ?> <ivy-module version= "2.0" > <info organisation= "net.sourceforge.saxon" module= "saxon" revision= "9.1.0.8" status= "release" publication= "20120502202413" default= "true" m:classifier= "s9api" /> <configurations> <conf name= "default" visibility= "public" /> </configurations> <publications> <artifact name= "saxon" type= "jar" ext= "jar" conf= "default" classifier= "s9api" /> <artifact name= "saxon" type= "jar" ext= "jar" conf= "default" classifier= "dom" /> </publications> </ivy-module> SC1 and SC2 for Ivy and SC2 for Grails <?xml version= "1.0" encoding= "UTF-8" ?> <ivy-module version= "2.0" xmlns:m = "http://ant.apache.org/ivy/maven" > <info organisation= "net.sourceforge.saxon" module= "saxon" revision= "9.1.0.8" status= "release" publication= "20100226065342" > <license name= "Mozilla Public License Version 1.0" url= "http://www.mozilla.org/MPL/MPL-1.0.txt" /> <description homepage= "http://saxon.sourceforge.net/" > Saxon a complete and conformant implementation of the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations published on 23 January 2007 by W3C </description> </info> <configurations> [...] </configurations> <publications> <artifact name= "saxon" type= "jar" ext= "jar" conf= "master" /> <artifact name= "saxon" type= "source" ext= "jar" conf= "sources" m:classifier= "sources" /> <artifact name= "saxon" type= "javadoc" ext= "jar" conf= "javadoc" m:classifier= "javadoc" /> </publications> </ivy-module> Hope it will help
          Hide
          Nicolas Labrot added a comment -

          Is this issue really closed ?

          It's seems there is another issue like explained on my previous comment.

          Show
          Nicolas Labrot added a comment - Is this issue really closed ? It's seems there is another issue like explained on my previous comment.
          Hide
          Graeme Rocher added a comment -

          fixed with Aether dependency management in 2.3

          Show
          Graeme Rocher added a comment - fixed with Aether dependency management in 2.3

            People

            • Assignee:
              Graeme Rocher
              Reporter:
              David Castro
            • Votes:
              17 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last Reviewed:

                Development