私はいくつかの成果物を Maven 中央リポジトリに公開しようとしていますが、現在のバージョンの gradle (0.9-rc2) は pgp を処理しないため、gradle 1.0 を待っている間に ant xmlバージョンを「移植」して試してみようと思いました。うまくいけば、箱から出してそれをサポートします。
私はgradleで次のように書きました:
def mvn =
groovy.xml.NamespaceBuilder.newInstance(ant, 'antlib:org.apache.maven.artifact.ant')
mvn.mvn {
arg(value: 'org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file')
arg(value: '-Durl=file:///tmp/repo2')
arg(value: '-DrepositoryId=sonatype-nexus-staging')
arg(value: '-DpomFile=pom.xml')
arg(value: '-Dfile=myjar.jar')
arg(value: '-Dfile=-Pgpg')
}
残念ながら、それは機能していません。私はこれを得ています:
Cause: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:mvn
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
スクリプトの先頭に以下を追加するなど、さまざまな組み合わせを試しました。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.apache.maven:maven-ant-tasks:2.1.1'
}
}
どんな助けでも大歓迎です
ありがとうヤン