From f16de1eff1771b9de21ff637c5e1692beb40c6df Mon Sep 17 00:00:00 2001 From: ramkumarvenkat Date: Thu, 30 Jan 2020 11:32:54 +0530 Subject: [PATCH] [BAEL-3735] Gradle to maven sample --- gradle/gradle-to-maven/build.gradle | 41 ++++++++++++++++++++++++++ gradle/gradle-to-maven/settings.gradle | 0 2 files changed, 41 insertions(+) create mode 100644 gradle/gradle-to-maven/build.gradle create mode 100644 gradle/gradle-to-maven/settings.gradle diff --git a/gradle/gradle-to-maven/build.gradle b/gradle/gradle-to-maven/build.gradle new file mode 100644 index 0000000000..110edbc421 --- /dev/null +++ b/gradle/gradle-to-maven/build.gradle @@ -0,0 +1,41 @@ +repositories { + mavenCentral() +} + +apply plugin: 'java' +apply plugin: 'maven' + +group = 'com.baeldung' + +// by default, pom's artifactId is taken from the directory name + +version = '0.0.1-SNAPSHOT' + +dependencies { + compile('org.slf4j:slf4j-api') + testCompile('junit:junit') +} + +install { + repositories { + mavenInstaller { + pom.version = '0.0.1-maven-SNAPSHOT' + pom.groupId = 'com.baeldung.sample' + pom.artifactId = 'gradle-maven-converter' + pom.project { + inceptionYear '2020' + licenses { + license { + name 'My License' + url 'http://www.mycompany.com/licenses/license.txt' + distribution 'repo' + } + } + } + pom.whenConfigured {pom -> + pom.dependencies.find {dep -> dep.groupId == 'junit' && dep.artifactId == 'junit' }.optional = true + } + pom.writeTo("${mavenPomDir}/${project.group}/${project.name}/pom.xml") + } + } +} \ No newline at end of file diff --git a/gradle/gradle-to-maven/settings.gradle b/gradle/gradle-to-maven/settings.gradle new file mode 100644 index 0000000000..e69de29bb2