Created
October 31, 2014 14:17
-
-
Save grafjo/6d133dc6e39659cc8359 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
Hi, I have been struggling with my spring boot jar after uploading to nexus. I have the StackOverflow link to my issue. Any help will be appreciated.
http://stackoverflow.com/questions/40846908/no-main-manifest-attribute-in-application-jar