-
-
Save andromedarabbit/65afb6ed8daddb4bd06d to your computer and use it in GitHub Desktop.
Example gradle build to upload a Spring Boot based jar to nexus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group = "foo" | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.8.RELEASE") | |
} | |
} | |
apply plugin: "java" | |
apply plugin: "maven" | |
apply plugin: "spring-boot" | |
sourceCompatibility = 1.8 | |
targetCompatibility = 1.8 | |
jar { | |
baseName = "bar" | |
version = "0.1.0-SNAPSHOT" | |
} | |
configurations { | |
deployerJars | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile("org.springframework.boot:spring-boot-starter-web") | |
compile("org.springframework.boot:spring-boot-starter-actuator") | |
testCompile("org.springframework.boot:spring-boot-starter-test") | |
deployerJars("org.apache.maven.wagon:wagon-http:2.7") | |
} | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
configuration = configurations.deployerJars | |
repository(url: "https://nexushost/content/repositories/releases") { | |
authentication( | |
userName: "user", | |
password: "password" | |
) | |
} | |
snapshotRepository(url: "https://nexushost/content/repositories/snapshots") { | |
authentication( | |
userName: "user", | |
password: "password", | |
) | |
} | |
pom { | |
groupId = project.group | |
artifactId = jar.baseName | |
version = jar.version | |
project { | |
parent { | |
groupId "org.springframework.boot" | |
artifactId "spring-boot-starter-parent" | |
version "1.1.8.RELEASE" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment