diff --git a/build.gradle b/build.gradle index ee3e3d2dbf..64f0bdacde 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,7 @@ buildscript { } plugins { + id 'base' id("org.nosphere.apache.rat") version "0.7.0" } @@ -59,6 +60,7 @@ ant.taskdef(name: "junit", classpath: configurations.antLibs.asPath) wrapper { + // https://stackoverflow.com/a/54741656/2066598 gradleVersion = '6.8' } @@ -78,6 +80,7 @@ wrapper.finalizedBy adjustWrapperPropertiesFile */ allprojects { apply plugin: 'eclipse' +// apply plugin: 'idea' } /** @@ -89,6 +92,7 @@ subprojects { //Put instructions for each sub project, but not the master apply plugin: 'java-library' apply plugin: 'jacoco' + apply plugin: 'maven-publish' version = '5.0.1-SNAPSHOT' ext { @@ -108,6 +112,10 @@ subprojects { options.encoding = 'UTF-8' } + tasks.withType(Jar) { + duplicatesStrategy = 'fail' + } + sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -127,7 +135,7 @@ subprojects { jar { manifest { - attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version + attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': project.version } } @@ -209,6 +217,56 @@ subprojects { jenkins.dependsOn javadoc jenkins.dependsOn jacocoTestReport jenkins.dependsOn rat + + publishing { + publications { + POI(MavenPublication) { + groupId 'org.apache.poi' + + pom { + packaging = 'jar' + url = 'https://poi.apache.org/' + + mailingLists { + mailingList { + name = 'POI Users List' + subscribe = 'user-subscribe@poi.apache.org' + unsubscribe = 'user-unsubscribe@poi.apache.org' + archive = 'http://mail-archives.apache.org/mod_mbox/poi-user/' + } + mailingList { + name = 'POI Developer List' + subscribe = 'dev-subscribe@poi.apache.org' + unsubscribe = 'dev-unsubscribe@poi.apache.org' + archive = 'http://mail-archives.apache.org/mod_mbox/poi-dev/' + } + } + + licenses { + license { + name = 'Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' + } + } + + organization { + name = 'Apache Software Foundation' + url = 'http://www.apache.org/' + } + + withXml { + def r = asElement() + def doc = r.getOwnerDocument() + def asl = doc.createComment(new File('../legal/HEADER').text) + // adding ASF header before root node is ignored + // doc.insertBefore(asl, doc.getDocumentElement()) + r.insertBefore(asl, r.getFirstChild()) + } + } + } + } + } } // Make JavaDoc behave similar to Ant, i.e. be a bit more lenient @@ -264,6 +322,10 @@ task allJavaDoc(type: Javadoc) { task jenkins jenkins.dependsOn allJavaDoc +clean { + delete "${rootDir}/build/dist" +} + rat { // Input directory, defaults to '.' inputDir.set(file(".")) @@ -306,3 +368,14 @@ rat { // Prints the list of files with unapproved licences to the console, defaults to false verbose.set(true) } + +/*task downloadJarsToLibs() { + def f = new File("$projectDir/../lib/ooxml/xmlbeans-5.0.0.jar") + if (!f.exists()) { + println 'writing file ' + f.getAbsolutePath() + f.getParentFile().mkdirs() + new URL('https://ci-builds.apache.org/job/POI/job/POI-XMLBeans-DSL-1.8/lastSuccessfulBuild/artifact/build/xmlbeans-5.0.0.jar').withInputStream{ i -> f.withOutputStream{ it << i }} + } +}*/ + +//compileJava.dependsOn 'downloadJarsToLibs' \ No newline at end of file diff --git a/build.xml b/build.xml index 221f22491d..3fd20748ba 100644 --- a/build.xml +++ b/build.xml @@ -89,9 +89,9 @@ under the License. - - - + + + @@ -115,65 +115,66 @@ under the License. - - - - + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + + + + + - - + + + - - - - - + + + + + - - - - - - - - + + + + + + + + @@ -347,21 +348,21 @@ under the License. - - - - - - + + + + + + - - - - + + + + @@ -623,13 +624,13 @@ under the License. - - - - - - - + + + + + + + @@ -972,8 +973,8 @@ under the License. - - + + @@ -1004,8 +1005,8 @@ under the License. - - + + @@ -1039,7 +1040,7 @@ under the License. @{module} - + @@ -1080,7 +1081,7 @@ under the License. - + @@ -1139,7 +1140,7 @@ under the License. - + @@ -1157,7 +1158,7 @@ under the License. - + @@ -1173,12 +1174,13 @@ under the License. - + @@ -1190,7 +1192,7 @@ under the License. - @@ -1208,7 +1210,7 @@ under the License. - @@ -1222,7 +1224,7 @@ under the License. - @@ -1242,9 +1244,21 @@ under the License. + + + + + + + + - - + + @@ -1304,8 +1318,8 @@ under the License. - - + @@ -1340,7 +1354,7 @@ under the License. - + @@ -1414,7 +1428,7 @@ under the License. - @@ -1459,7 +1473,7 @@ under the License. - + + manifest="poi-integration/build/poi-manifest.mf"/> - + @@ -1821,7 +1835,7 @@ under the License. - + @@ -1830,11 +1844,11 @@ under the License. - ${full.schema}${lite.exports}} + ${full.schema}${lite.exports}} @@ -1869,7 +1883,7 @@ under the License. - + @@ -2185,7 +2199,7 @@ under the License. - + @@ -2261,7 +2275,7 @@ under the License. - + @@ -2280,7 +2294,7 @@ under the License. - + @@ -2340,7 +2354,7 @@ under the License. scripts/**, TEST*, *.ipr, - *.iml, + **/*.iml, *.iws, *.lnk, *.rdf, @@ -2437,24 +2451,24 @@ under the License. uri="antlib:org.apache.rat.anttasks" classpath="${rat.jar}" /> - - - - + + + + - + - + - + @@ -2690,11 +2704,11 @@ under the License. - - - - - + + + + + @@ -2920,7 +2934,7 @@ under the License. - + @@ -3044,7 +3058,7 @@ under the License. - +