cd /home/centos/gitclones/gradletest
gradle init --type java-application
gradle build
vi build.gradle
add to plugins:
id 'maven'
maven Plugin for Gradle is documented here https://docs.gradle.org/current/userguide/maven_plugin.html
gradle install
ls -ltra /home/centos/.m2/repository/gradletest/unspecified/
total 4956 -rw-r--r-- 1 centos docker 2371522 Apr 29 13:23 gradletest-unspecified.zip -rw-r--r-- 1 centos docker 2693120 Apr 29 13:23 gradletest-unspecified.tar -rw-r--r-- 1 centos docker 752 Apr 29 13:23 gradletest-unspecified.jar -rw-r--r-- 1 centos docker 756 Apr 29 13:23 gradletest-unspecified.pom
cat /home/centos/.m2/repository/gradletest/unspecified/gradletest-unspecified.pom
<groupId></groupId> <artifactId>gradletest</artifactId> <version>unspecified</version>
group and version are missing!
then you can follow the steps here https://medium.com/dot-debug/deploying-artifacts-to-maven-using-gradle-b669acc1b6f8
you define the group and version in your projects' build.gradle, you define nexus username/password/url in ~/.gradle/gradle.properties and you use the maven-publish plugin to publish to Nexus
No comments:
Post a Comment