我想知道如何用"Gradle Android Maven插件"创建一个pom文件.
我按照http://www.gradle.org/docs/current/userguide/maven_plugin.html("公约方法"一章)中的步骤进行操作.我还创建了目录"buildDir"并且没有错误.该应用程序已成功构建,但仍然不存在pom文件.我正在使用Android Studio IDE.
newpom.xml文件是否可能仅在运行时存在,并且在运行时之后在我的项目文件夹buildDir中不存在?也许我正在寻找一些无法找到的东西.
我的app/build.gradle看起来像这样:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
apply plugin: 'maven'
task writeNewPom << {
pom {
project {
inceptionYear '2008'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("$buildDir/newpom.xml")
}
dependencies {
compile 'com.android.support:support-v4:+'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:appcompat-v7:+'
compile …Run Code Online (Sandbox Code Playgroud)