Menu

Version 1.x in maven?

Help
2007-03-28
2013-04-29
  • Tiran Kenja

    Tiran Kenja - 2007-03-28

    It seems the version 1.x versions of JSON-lib is now postfixed with the jdk version. I find that a bit strange since that breaks with how maven-generated artifacts are supposed to be named. And will require extra configuration to get working.

    Any reason they are not simply named like this:
    json-lib-jdk15-1.0.jar

    That would keep the maven naming conventions and still show JDK version.

    Anyone know how to add this as a dependency anyway? It seems maven 2 does not have the option to specify the artifact name like maven 1 did? Or if it does I can't find the documentation for it anyway.

     
    • aalmiray

      aalmiray - 2007-03-28

      Tiran,
      Its supposed to work with Maven2 when you use a classifier. The maven2 documentation states that the classifier is
      postfixed after the version (http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_dependency)
      "The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but were built differently, and is appended to the filename after the version. For example, jdk14 and jdk15."

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

      will load json-lib-1.0-jdk15.jar as expected.

      For maven 1 you'll have to do something like

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

       
    • Tiran Kenja

      Tiran Kenja - 2007-03-29

      Ah. I missed the classifier thing. Maven documentation isn't exactly the most user friendly. And I didn't get around to looking in 'the book'

       
    • Tiran Kenja

      Tiran Kenja - 2007-03-29

      Hmm. Don't seem to work for downloading source and javadoc tho. But that may be an issue with the Maven 2 plugin for Eclipse.

       
      • aalmiray

        aalmiray - 2007-03-29

        Yes, it doesn't work with source and javadoc yet :(
        I'll noticed a couple of months ago but didn't check the plugin page
        for an explanation. I'll check later if there is any update on that.

        Cheers,
        Andres

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.