Skip to content

Instantly share code, notes, and snippets.

@jpaulm
Created February 19, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpaulm/69e70729db3e94e2bff063c602340602 to your computer and use it in GitHub Desktop.
Save jpaulm/69e70729db3e94e2bff063c602340602 to your computer and use it in GitHub Desktop.
Problems finding jar files for sources and javadoc
// Gradle migrated to v6.2.0
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
//classpath 'com.github.rholder:gradle-one-jar:1.0.4'
}
}
//plugins {
// id 'maven'
//}
apply plugin: 'io.codearte.nexus-staging'
subprojects {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
//apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'java-library'
}
version = '2.19.2'
group = 'com.jpaulmorrison'
description = 'DrawFBP is a picture-drawing tool that allows users to create multi-level diagrams implementing the technology and methodology known as Flow-Based Programming (FBP). Diagrams are saved in DrawFBP XML format, and will generate JavaFBP or C#FBP networks.'
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
mainClassName = 'com.jpaulmorrison.graphics.DrawFBP'
nexusStaging {
username = ossrhUser
password = ossrhPassword
}
repositories {
mavenCentral()
}
dependencies {
implementation ('math.geom2d:javaGeom:0.11.1')
implementation ('javax.help:javahelp:2.0.05')
}
// if going to Maven, have to suppress jar
jar {
manifest {
attributes 'Implementation-Title': 'DrawFBP', 'Implementation-Version': archiveVersion,
"Class-Path": configurations.compileClasspath.collect { it.getName() }.join(' '),
'Main-Class' : mainClassName
}
//manifest {
// attributes 'Implementation-Title': 'DrawFBP with javaGeom and JavaHelp jar files',
// 'Implementation-Version': archiveVersion,
// "Class-Path": configurations.compileClasspath.collect { it.getName() }.join(' '),
// 'Main-Class': 'com.jpaulmorrison.graphics.DrawFBP'
// }
//baseName = project.name + '-all'
archiveBaseName = project.name
from sourceSets.main.output
dependsOn configurations.compileClasspath
from {
configurations.compileClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
exclude('math/geom2s/**')
exclude('math/geom3d/**')
exclude('math/geom2s/**')
exclude('math/utils/**')
exclude('math/package/html')
exclude('com/seisw/util/geom/**')
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:none', true)
}
}
ext {
snapshotPublicationRepository = "https://oss.sonatype.org/content/repositories/snapshots/"
releasePublicationRepository = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
mainClassName = 'com.jpaulmorrison.graphics.DrawFBP'
ossrhUser = project.hasProperty('ossrhUser') ? project.property('ossrhUser') : ""
osshrPassword = project.hasProperty('osshrPassword') ? project.property('osshrPassword') : ""
}
ext {
snapshotPublicationRepository = "https://oss.sonatype.org/content/repositories/snapshots/"
releasePublicationRepository = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
mainClassName = 'com.jpaulmorrison.graphics.DrawFBP'
ossrhUser = project.hasProperty('ossrhUser') ? project.property('ossrhUser') : ""
osshrPassword = project.hasProperty('osshrPassword') ? project.property('osshrPassword') : ""
}
// Used to generate initial maven-dir layout
task "create-dirs" {
doLast {
description = "Create default maven directory structure"
//}
// {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar,sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'DrawFBP'
description = 'Diagramming Tool for Flow-Based Programming'
// groupId 'com.jpaulmorrison'
packaging 'jar'
url = 'https://github.com/jpaulm/drawfbp'
//properties = [
// myProp: "value",
// "prop.with.dots": "anotherValue"
// ]
credentials {
username = ossrhUser
password = ossrhPassword
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
license {
name = 'GNU Lesser General Public License, Version 3.0'
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
}
}
developers {
developer {
id = 'jpaulmorr'
name = 'John Paul Rodker Morrison (Software architect/developer)'
email = 'jpaulmorr@gmail.com'
}
developer {
id = 'bobcorrick'
name = 'Bob Corrick (Software architect/developer)'
email = 'bobcorrick@outlook.com'
}
}
scm {
connection = 'scm:git:git:https://github.com/jpaulm.git'
developerConnection = 'scm:git:ssh:https://github.com/jpaulm.git'
url = 'https://github.com/jpaulm.git'
}
}
}
}
repositories {
maven {
// def releasesRepoUrl = "$buildDir/repos/releases"
// def releasesRepoUrl = "https://oss.sonatype.org/content/repositories/releases/"
// def snapshotsRepoUrl = "$buildDir/repos/snapshots"
// def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
// url (version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl)
url (version.endsWith('SNAPSHOT') ? snapshotPublicationRepository : releasePublicationRepository)
}
}
/*
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
}
}
*/
//signing {
// sign publishing.publications.mavenJava
//
signing {
required {
// signing is required if this is a release version and the artifacts are to be published
!version.toString().endsWith('-SNAPSHOT') && tasks.withType(PublishToMavenRepository).find {
gradle.taskGraph.hasTask it
}
}
sign publishing.publications
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment