2013-02-28 11 views
5

最初に私はここに質問されたのと同じ種類の質問を grails plugin dependencies with classifiersに伝えたいですが、答えはありません。Grailsは "クラシファイア"を使って依存関係を追加しません。

jar "json-lib.jar"とその依存関係をBuildConfig.groovyファイルに追加しようとしています。この依存関係には、依存関係をダウンロードできないという要素があります。

dependencies {runtime group:'net.sf.json-lib', name:'json-lib', classifier:'jdk15',version:'2.4'} 

しかし、これは役に立ちません。 { ':JSON-libに:2.4:net.sf.json-LIB jdk15' ランタイム}

は、私はまた、この

`依存関係のように試してみました。この1はまた助けない

でも、MavenのPOMファイルを作成しようとした「JSON-lib.jar」依存POMファイルに同じを取得しますが、私のJavaのMavenプロジェクトで同じ依存関係を使用してみた場合、それは罰金

<dependency> 
<groupId>net.sf.json-lib</groupId> 
<artifactId>json-lib</artifactId> 
    <version>2.4</version> 
    <type>jar</type> 
    <classifier>jdk15</classifier> 
    <scope>compile</scope> 
</dependency> 

に動作します。しかし、この1追加lsoは役に立たない。 (STSでは)の依存関係を更新しようとしているの

私のエラーメッセージの後には動作するはず事前に

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


==== grailsHome: tried 

    C:\Users\Target\.grails\2.1.1\cached-installed-plugins/json-lib-2.4.jar 

==== grailsHome: tried 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1/plugins/json-lib-2.4.jar 

==== grailsCentral: tried 

    http://grails.org/plugins/grails-json-lib/tags/RELEASE_2.4/grails-json-lib-2.4.jar 

==== http://repo.grails.org/grails/core: tried 

    http://repo.grails.org/grails/core/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== localMavenResolver: tried 

    C:\Users\Target/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== mavenCentral: tried 

    http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== ebrRelease: tried 

    http://repository.springsource.com/maven/bundles/release/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== ebrExternal: tried 

    http://repository.springsource.com/maven/bundles/external/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== http://download.java.net/maven/2/: tried 

    http://download.java.net/maven/2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== localMavenResolver: tried 

    C:\Users\Target/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

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

    ::    FAILED DOWNLOADS   :: 

    ::^see resolution messages for details^:: 

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

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

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


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


==== grailsHome: tried 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1/lib/net.sf.json-lib/json-lib/jars/json-lib-2.4.jar 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1/lib/net.sf.json-lib/json-lib/bundles/json-lib-2.4.jar 

==== grailsHome: tried 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1\src\libs/json-lib-2.4.jar 

==== grailsHome: tried 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1\dist/json-lib-2.4.jar 

==== grailsHome: tried 

    C:\Users\Target\.grails\2.1.1\cached-installed-plugins/json-lib-2.4.jar 

==== grailsHome: tried 

    C:\Users\Target\Software\Groovy -STS\Installed Directory\grails-2.1.1/plugins/json-lib-2.4.jar 

==== grailsCentral: tried 

    http://grails.org/plugins/grails-json-lib/tags/RELEASE_2.4/grails-json-lib-2.4.jar 

==== http://repo.grails.org/grails/core: tried 

    http://repo.grails.org/grails/core/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== localMavenResolver: tried 

    C:\Users\Target/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== mavenCentral: tried 

    http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== ebrRelease: tried 

    http://repository.springsource.com/maven/bundles/release/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== ebrExternal: tried 

    http://repository.springsource.com/maven/bundles/external/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== http://download.java.net/maven/2/: tried 

    http://download.java.net/maven/2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

==== localMavenResolver: tried 

    C:\Users\Target/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar 

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

    ::    FAILED DOWNLOADS   :: 

    ::^see resolution messages for details^:: 

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

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

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


| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information): 

- net.sf.json-lib:json-lib:2.4 

おかげ..

答えて

0

は、こちらを参照してください。またhttp://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4#gradle

dependencies { 
    runtime 'net.sf.json-lib:json-lib:2.4' 
} 

を、 MavenLocalとMavenCentralリポジトリを有効にしているかどうか確認してください:

repositories { 
    grailsPlugins() 
    grailsHome() 
    grailsCentral() 

    // uncomment the below to enable remote dependency resolution 
    // from public Maven repositories 

    mavenLocal() 
    mavenCentral() 
    //mavenRepo "http://snapshots.repository.codehaus.org" 
    //mavenRepo "http://repository.codehaus.org" 
    //mavenRepo "http://download.java.net/maven/2/" 
    //mavenRepo "http://repository.jboss.com/maven2/" 
} 
関連する問題