直接在build.gradle中添加如下内容。
apply plugin: 'java'
apply plugin: 'maven'
group = 'xxx.xxx'
version = '1.0-SNAPSHOT'
task writeNewPom << {
pom {
project {
inceptionYear '2018'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("pom.xml")
}
然后点击右侧Gradle,找到writeNewPom并点击运行。
运行完成后会得到pom.xml