Skip to content

Commit

Permalink
0005140: Publish to maven using maven-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Marzullo committed May 12, 2022
1 parent 5e1bb63 commit 36cff95
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 50 deletions.
34 changes: 20 additions & 14 deletions symmetric-assemble/common.gradle
Expand Up @@ -86,7 +86,7 @@ subprojects { subproject ->

apply plugin: 'com.github.hierynomus.license'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'

configurations { deployerJars }
Expand All @@ -103,8 +103,6 @@ subprojects { subproject ->
}
}
api.extendsFrom(provided)
project.conf2ScopeMappings.addMapping(300 + 1,
project.configurations.provided, "provided")
// Ensure only the compile configuration is exported
project.eclipse.classpath.file {
whenMerged { classpath ->
Expand Down Expand Up @@ -232,8 +230,7 @@ subprojects { subproject ->
}
}

install.enabled = !project.properties.containsKey('pro')
uploadArchives.enabled = !project.properties.containsKey('pro')
publish.enabled = !project.properties.containsKey('pro')


task sourcesJar(type: Jar, dependsOn:classes) {
Expand All @@ -243,18 +240,27 @@ subprojects { subproject ->

artifacts { archives sourcesJar }

uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: deployUploadUrl) {
authentication(userName: deployUser, password: deployPassword)
}
}
}
publishing {
publications {
symmetricLibrary(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = "jumpmindMaven"
credentials {
username deployUser
password deployPassword
}
url = deployUploadUrl
}
}
}

task deploy {
description 'Shortcut for Maven users'
dependsOn tasks.uploadArchives
dependsOn tasks.publish
}

task testJar(type: Jar) {
Expand Down
54 changes: 24 additions & 30 deletions symmetric-assemble/standalone.publish.gradle
Expand Up @@ -3,34 +3,28 @@
* Modify file path and pom info: ./gradlew -b standalone.publish.gradle uploadAllJars
*/

apply plugin:'maven'

configurations{ allJars }

artifacts{ allJars file("/Users/cshenso/Dropbox/Jdbc/postgresql-9.4.1212.jre7.jar") }

configurations { deployerJars }

repositories {
mavenCentral()
}

uploadAllJars {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: deployUploadUrl) {
authentication(userName: deployUser, password: deployPassword)
}
pom.version = "9.4-1212.jre7"
pom.artifactId = "postgresql"
pom.groupId = "jdbc.postgresql"
}
}

}

dependencies {
deployerJars "org.apache.maven.wagon:wagon-ssh:3.5.1"

apply plugin:'maven-publish'

publishing {
publications {
myLibrary(MavenPublication) {
artifact ("/Users/philipmarzullo/symmetric-workspaces/symmetric-workspace-3.14/git/symmetric-ds/symmetric-assemble/phil.jar")
groupId "phil.test"
artifactId "phil"
version "1.1.1"
}
}
repositories {
maven {
credentials {
username deployUser
password deployPassword
}
url = deployUploadUrl
}
}
}

task uploadAllJars {
dependsOn tasks.publish
}
6 changes: 0 additions & 6 deletions symmetric-sqlexplorer/build.gradle
Expand Up @@ -17,10 +17,6 @@ plugins {

apply from: symAssembleDir + '/common.gradle'

apply plugin: 'maven'

configurations { deployerJars }

artifacts {
archives file("$buildDir/libs/${jar.archiveBaseName.get()}-${jar.archiveVersion.get()}.${jar.archiveExtension.get()}")
}
Expand All @@ -30,8 +26,6 @@ configurations.archives.with {
}

dependencies {
deployerJars "org.apache.maven.wagon:wagon-ssh:3.5.1"

compile project(":symmetric-jdbc")
compile project(":symmetric-io")

Expand Down

0 comments on commit 36cff95

Please sign in to comment.