Gradleでの展開のために、従属ライブラリをディレクトリにエクスポートするにはどうすればよいですか?

StackOverflow https://stackoverflow.com/questions/3872377

  •  28-09-2019
  •  | 
  •  

質問

コードを別のマシンに展開する必要があります。従属ジャーをLIBディレクトリにエクスポートするにはどうすればよいですか?

役に立ちましたか?

解決

これが正しい方法であるかどうかはわかりませんが、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
  }

他のヒント

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

task copyToLib(type: Copy) {
    // into "build/lib"
    into "lib"
    from configurations.classpath
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top