6

コードを別のマシンにデプロイする必要があります。依存する jar を lib ディレクトリにエクスポートするにはどうすればよいですか?

4

2 に答える 2

4

Gradle 2.xでそれを行う方法は次のとおりです。

task copyToLib(type: Copy) {
    // into "build/lib"
    into "lib"
    from configurations.classpath
}
于 2013-03-30T02:59:53.297 に答える
3

これが正しい方法かどうかはわかりませんが、jar を lib ディレクトリにコピーするには、次のようにします。

/**
 * Copies the dependencies to the lib directory in preparation for them to be added to a jar file
 */
 task copyRuntimeDependencies(dependsOn: configurations.runtime.buildArtifacts, type: Copy) 
  {
    into('build/output/lib')
    from configurations.runtime
    from configurations.runtime.allArtifacts*.file
  }
于 2010-10-18T12:35:39.603 に答える