diff --git a/mongo-java-driver-gradle-local-fixes.patch b/mongo-java-driver-gradle-local-fixes.patch new file mode 100644 index 0000000..bf662ea --- /dev/null +++ b/mongo-java-driver-gradle-local-fixes.patch @@ -0,0 +1,451 @@ +diff --git a/bson/build.gradle b/bson/build.gradle +index 3afa8ae0e..aa8e6afa7 100644 +--- a/bson/build.gradle ++++ b/bson/build.gradle +@@ -16,30 +16,19 @@ + + apply plugin: 'osgi' + apply plugin: 'java' +-apply plugin: 'org.kordamp.gradle.clirr' + + def configDir = new File(rootDir, 'config') + archivesBaseName = 'bson' + +-clirr { +- excludeFilter = new File("$configDir/clirr-exclude.yml") +- baseline 'org.mongodb:bson:3.4.0' +- failOnErrors = true +-} + + jar { + manifest { +- instruction 'Build-Version', getGitVersion() + instruction 'Import-Package', + 'javax.xml.bind.*', + 'org.slf4j;resolution:=optional' + } + } + +-modifyPom { +- project { +- name 'BSON' +- description 'The BSON library' +- url 'http://bsonspec.org' +- } ++sourceSets { ++ main { java.srcDirs = ['src/main'] } + } +diff --git a/build.gradle b/build.gradle +index 2c67187b9..67aeb0d7d 100644 +--- a/build.gradle ++++ b/build.gradle +@@ -31,12 +31,6 @@ buildscript { + maven { url "https://plugins.gradle.org/m2/" } + mavenLocal() + } +- dependencies { +- classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2' +- classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+' +- classpath 'com.bmuschko:gradle-nexus-plugin:2.2' +- classpath "gradle.plugin.com.github.spotbugs:gradlePlugin:1.6.0" +- } + } + + ////////////////////////////////////////// +@@ -45,7 +39,6 @@ buildscript { + + configure(subprojects.findAll { it.name != 'util' }) { + apply plugin: 'java' +- apply plugin: 'optional-base' + + evaluationDependsOn(':util') + +@@ -61,7 +54,7 @@ configure(subprojects.findAll { it.name != 'util' }) { + } + + dependencies { +- compile 'org.slf4j:slf4j-api:1.7.6', optional ++ compile 'org.slf4j:slf4j-api:1.7.6' + } + + /* Compiling */ +@@ -113,168 +106,6 @@ configure(subprojects.findAll { it.name != 'util' }) { + } + } + +-def getGitVersion() { +- def outputAsString +- new ByteArrayOutputStream().withStream { os -> +- def result = exec { +- executable 'git' +- args 'describe', '--tags', '--always', '--dirty' +- standardOutput = os +- } +- outputAsString = os.toString().substring(1).trim() +- } +- return outputAsString +-} +- +-configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driver' }) { +- apply plugin: 'checkstyle' +- apply plugin: "com.github.spotbugs" +- apply plugin: 'jacoco' +- apply plugin: 'groovy' +- apply plugin: 'codenarc' +- +- dependencies { +- testCompile 'org.codehaus.groovy:groovy-all:2.4.12' +- testCompile 'org.spockframework:spock-core:1.1-groovy-2.4' +- testCompile 'cglib:cglib-nodep:2.2.2' +- testCompile 'org.objenesis:objenesis:1.3' +- testCompile 'org.hamcrest:hamcrest-all:1.3' +- testCompile 'ch.qos.logback:logback-classic:1.1.1' +- testCompile project(':util') //Adding categories to classpath +- } +- +- sourceSets { +- main { +- java.srcDirs = ['src/main'] +- } +- test { +- groovy.srcDirs = ['src/test/functional', 'src/test/unit'] +- } +- } +- +- /* Testing */ +- tasks.withType(Test) { +- maxHeapSize = "3g" +- maxParallelForks = 1 +- +- systemProperties( +- 'org.mongodb.test.uri': System.getProperty('org.mongodb.test.uri'), +- 'org.mongodb.useSocket': System.getProperty('org.mongodb.useSocket', 'false'), +- 'org.mongodb.disableAsync': System.getProperty('org.mongodb.disableAsync', 'false'), +- 'org.mongodb.async.type': System.getProperty('org.mongodb.async.type', 'nio2'), +- +- 'javax.net.ssl.trustStore': System.getProperty('javax.net.ssl.trustStore'), +- 'javax.net.ssl.keyStore': System.getProperty('javax.net.ssl.keyStore'), +- 'javax.net.ssl.keyStorePassword': System.getProperty('javax.net.ssl.keyStorePassword'), +- 'javax.net.ssl.trustStorePassword': System.getProperty('javax.net.ssl.trustStorePassword') +- ) +- +- if (project.buildingWith('ssl.enabled')) { +- systemProperties( +- 'javax.net.ssl.keyStoreType': project.property('ssl.keyStoreType'), +- 'javax.net.ssl.keyStore': project.property('ssl.keyStore'), +- 'javax.net.ssl.keyStorePassword': project.property('ssl.keyStorePassword'), +- 'javax.net.ssl.trustStoreType': project.property('ssl.trustStoreType'), +- 'javax.net.ssl.trustStore': project.property('ssl.trustStore'), +- 'javax.net.ssl.trustStorePassword': project.property('ssl.trustStorePassword') +- ) +- } +- +- if (project.buildingWith('gssapi.enabled')) { +- systemProperties( +- 'sun.security.krb5.debug': project.getProperty('sun.security.krb5.debug'), +- 'javax.security.auth.useSubjectCredsOnly': "false", +- 'java.security.krb5.kdc': project.getProperty('krb5.kdc'), +- 'java.security.krb5.realm': project.getProperty('krb5.realm'), +- 'java.security.auth.login.config': project.getProperty('auth.login.config'), +- ) +- } +- +- useJUnit { +- if (!project.buildingWith('rs.enabled')) { +- excludeCategories 'category.ReplicaSet' +- } +- if (project.buildingWith('quicktest')) { +- excludeCategories 'category.SlowUnit' +- } +- if (project.buildingWith('travistest')) { +- excludeCategories 'category.SlowUnit', 'category.Slow' +- } +- } +- +- jacoco { enabled = false } +- +- testLogging { exceptionFormat = 'full' } +- } +- +- task testSlowUnit(type: Test) { +- useJUnit { +- includeCategories 'category.SlowUnit' +- } +- } +- +- gradle.taskGraph.whenReady { taskGraph -> +- if (taskGraph.hasTask(testCoverage)) { +- tasks.withType(Test) { jacoco { enabled = true } } +- } +- } +- +- task testCoverage(dependsOn: test) +- +- /* Code quality */ +- +- checkstyle { +- toolVersion = "7.4" +- configFile = new File(configDir, 'checkstyle.xml') +- configProperties.checkstyleConfigDir = configDir +- } +- +- spotbugs { +- excludeFilter = new File(configDir, 'findbugs-exclude.xml') +- sourceSets = [sourceSets.main] +- toolVersion = '3.1.0' +- } +- +- codenarc { +- toolVersion = '1.0' +- reportFormat = project.buildingWith('xmlReports.enabled') ? 'xml' : 'html' +- } +- +- tasks.withType(com.github.spotbugs.SpotBugsTask) { +- reports { +- xml.enabled = project.buildingWith('xmlReports.enabled') +- html.enabled = !project.buildingWith('xmlReports.enabled') +- } +- } +- +- tasks.withType(Test) { +- def jdkHome = findProperty("jdkHome") +- if (jdkHome) { +- def javaExecutablesPath = new File(jdkHome, 'bin') +- def javaExecutables = [:].withDefault { execName -> +- def executable = new File(javaExecutablesPath, execName) +- assert executable.exists() : "There is no ${execName} executable in ${javaExecutablesPath}" +- executable +- } +- executable = javaExecutables.java +- } +- } +-} +- +-task docs(type: Javadoc) { +- destinationDir = new File(projectDir, 'build/docs') +- options { options -> setJavaDocOptions(options) } +- subprojects.grep({ it.name != 'util' }).each { proj -> +- proj.tasks.withType(Javadoc).each { javadocTask -> +- source += javadocTask.source +- classpath += javadocTask.classpath +- excludes += javadocTask.excludes +- includes += javadocTask.includes +- dependsOn +=javadocTask.dependsOn +- } +- } +-} +- + def setJavaDocOptions(MinimalJavadocOptions options) { + options.author = true + options.version = true +@@ -333,6 +164,3 @@ gradle.buildFinished { BuildResult result -> + } + } + +-apply from: 'gradle/deploy.gradle' +-apply from: 'gradle/TestColorOutput.gradle' +- +diff --git a/driver-async/build.gradle b/driver-async/build.gradle +index 8c38cb20b..f6ca17d19 100644 +--- a/driver-async/build.gradle ++++ b/driver-async/build.gradle +@@ -15,13 +15,12 @@ + */ + + apply plugin: 'osgi' +-apply plugin: 'org.kordamp.gradle.clirr' + + def configDir = new File(rootDir, 'config') + archivesBaseName = 'mongodb-driver-async' + + sourceSets { +- test.groovy.srcDirs += 'src/examples' ++ test.java.srcDirs += 'src/examples' + } + + dependencies { +@@ -32,12 +31,6 @@ dependencies { + testCompile project(':driver-core').sourceSets.test.output + } + +-clirr { +- excludeFilter = new File("$configDir/clirr-exclude.yml") +- baseline 'org.mongodb:mongodb-driver-async:3.4.0' +- failOnErrors = false +-} +- + tasks.withType(Checkstyle) { + // needed so the Javadoc checks can find the code in other modules + classpath = files(project(':driver-core').sourceSets.main.output, sourceSets.main.output) +@@ -45,7 +38,6 @@ tasks.withType(Checkstyle) { + + jar { + manifest { +- instruction 'Build-Version', getGitVersion() + instruction 'Import-Package', + 'org.bson.*', + 'com.mongodb.*', +@@ -53,10 +45,6 @@ jar { + } + } + +-modifyPom { +- project { +- name 'MongoDB Asynchronous Driver' +- description 'The MongoDB Asynchronous Driver' +- url 'http://www.mongodb.org' +- } ++sourceSets { ++ main { java.srcDirs = ['src/main'] } + } +diff --git a/driver-core/build.gradle b/driver-core/build.gradle +index bf516508e..6db365b1b 100644 +--- a/driver-core/build.gradle ++++ b/driver-core/build.gradle +@@ -15,31 +15,23 @@ + */ + + apply plugin: 'osgi' +-apply plugin: 'org.kordamp.gradle.clirr' + + def configDir = new File(rootDir, 'config') + archivesBaseName = 'mongodb-driver-core' + +-clirr { +- excludeFilter = new File("$configDir/clirr-exclude.yml") +- baseline 'org.mongodb:mongodb-driver-core:3.4.0' +- failOnErrors = false +-} +- + dependencies { + compile project(':bson') + +- compile "io.netty:netty-buffer:$nettyVersion", optional +- compile "io.netty:netty-transport:$nettyVersion", optional +- compile "io.netty:netty-handler:$nettyVersion", optional +- compile "org.xerial.snappy:snappy-java:$snappyVersion", optional ++ compile "io.netty:netty-buffer:$nettyVersion" ++ compile "io.netty:netty-transport:$nettyVersion" ++ compile "io.netty:netty-handler:$nettyVersion" ++ compile "org.xerial.snappy:snappy-java:$snappyVersion" + + testCompile project(':bson').sourceSets.test.output + } + + jar { + manifest { +- instruction 'Build-Version', getGitVersion() + instruction 'Import-Package', + 'org.bson.*', // unfortunate that this is necessary, but if it's left out then it's not included + 'javax.crypto.*', +@@ -56,11 +48,6 @@ jar { + } + } + +-modifyPom { +- project { +- name 'MongoDB Java Driver Core' +- description 'The Java operations layer for the MongoDB Java Driver. Third parties can \' +\n' + +- ' \'wrap this layer to provide custom higher-level APIs' +- url 'http://www.mongodb.org' +- } ++sourceSets { ++ main { java.srcDirs = ['src/main'] } + } +diff --git a/driver/build.gradle b/driver/build.gradle +index 9b689bad0..473f4973b 100644 +--- a/driver/build.gradle ++++ b/driver/build.gradle +@@ -14,13 +14,11 @@ + * limitations under the License. + */ + +-apply plugin: 'org.kordamp.gradle.clirr' +- + archivesBaseName = 'mongodb-driver' + def configDir = new File(rootDir, 'config') + + sourceSets { +- test.groovy.srcDirs += ['src/examples'] ++ test.java.srcDirs += ['src/examples'] + } + + test { +@@ -35,21 +33,12 @@ dependencies { + testCompile project(':driver-core').sourceSets.test.output + } + +-clirr { +- excludeFilter = new File("$configDir/clirr-exclude.yml") +- baseline 'org.mongodb:mongodb-driver:3.4.0' +- failOnErrors = false +-} + + tasks.withType(Checkstyle) { + // needed so the Javadoc checks can find the code in other modules + classpath = files(project(':driver-core').sourceSets.main.output, sourceSets.main.output) + } + +-modifyPom { +- project { +- name 'MongoDB Driver' +- description 'The MongoDB Driver' +- url 'http://www.mongodb.org' +- } ++sourceSets { ++ main { java.srcDirs = ['src/main'] } + } +diff --git a/mongo-java-driver/build.gradle b/mongo-java-driver/build.gradle +index 72973a33c..d8f2b4909 100644 +--- a/mongo-java-driver/build.gradle ++++ b/mongo-java-driver/build.gradle +@@ -27,10 +27,10 @@ idea { + + // dependencies copied from driver-core + dependencies { +- compile "io.netty:netty-buffer:$nettyVersion", optional +- compile "io.netty:netty-transport:$nettyVersion", optional +- compile "io.netty:netty-handler:$nettyVersion", optional +- compile "org.xerial.snappy:snappy-java:$snappyVersion", optional ++ compile "io.netty:netty-buffer:$nettyVersion" ++ compile "io.netty:netty-transport:$nettyVersion" ++ compile "io.netty:netty-handler:$nettyVersion" ++ compile "org.xerial.snappy:snappy-java:$snappyVersion" + } + + // srcDirs copied as well, so everything is compiled twice +@@ -45,7 +45,6 @@ sourceSets { + // copied from driver-core + jar { + manifest { +- instruction 'Build-Version', getGitVersion() + instruction 'Import-Package', + 'javax.xml.bind.*', + 'javax.crypto.*', +@@ -61,12 +60,4 @@ jar { + 'org.xerial.snappy.*;resolution:=optional', + 'org.slf4j;resolution:=optional' + } +- } +- +-modifyPom { +- project { +- name 'MongoDB Java Driver' +- description 'The MongoDB Java Driver uber-artifact, containing mongodb-driver, mongodb-driver-core, and bson' +- url 'http://www.mongodb.org' +- } + } +diff --git a/util/build.gradle b/util/build.gradle +index ba3d0e444..da4b4c7fa 100644 +--- a/util/build.gradle ++++ b/util/build.gradle +@@ -19,6 +19,9 @@ apply plugin: 'java' + sourceCompatibility = '1.6' + targetCompatibility = '1.6' + ++group = 'org.mongodb' ++archivesBaseName = 'mongodb-javadoc-utils' ++ + dependencies { + compile files("${System.getProperty('java.home')}/../lib/tools.jar") + } diff --git a/mongo-java-driver.spec b/mongo-java-driver.spec new file mode 100644 index 0000000..b995812 --- /dev/null +++ b/mongo-java-driver.spec @@ -0,0 +1,122 @@ +%{?scl:%scl_package mongo-java-driver} +%{!?scl:%global pkg_name %{name}} +%{?java_common_find_provides_and_requires} +Name: %{?scl_prefix}mongo-java-driver +Version: 3.6.4 +Release: 1 +Summary: A Java driver for MongoDB +BuildArch: noarch +License: ASL 2.0 +URL: http://www.mongodb.org/display/DOCS/Java+Language+Center +Source0: https://github.com/mongodb/mongo-java-driver/archive/r%{version}.tar.gz +Patch0: %{pkg_name}-gradle-local-fixes.patch +%{!?scl: +BuildRequires: java-devel +} +BuildRequires: gradle-local javapackages-tools javapackages-local mvn(io.netty:netty-buffer) +BuildRequires: mvn(io.netty:netty-transport) mvn(io.netty:netty-handler) +BuildRequires: mvn(org.slf4j:slf4j-api) mvn(org.xerial.snappy:snappy-java) +%{!?scl: +Requires: javapackages-tools +} +%{?scl: +Requires: %{scl_runtime} +} +%description +This is an ueber jar for the MongoDB Java driver. + +%package bson +Summary: A Java-based BSON implementation +%{!?scl: +Requires: javapackages-tools +} +%{?scl: +Requires: %{scl_runtime} +} +%description bson +This is the Java implementation of BSON that the Java driver for +MongoDB ships with. It can be used separately by Java applications +that require BSON. + +%package driver +Summary: The MongoDB Java Driver +%{!?scl: +Requires: javapackages-tools +} +%{?scl: +Requires: %{scl_runtime} +} +%description driver +The MongoDB Java Driver + +%package driver-core +Summary: The MongoDB Java Operations Layer +%{!?scl: +Requires: javapackages-tools +} +%{?scl: +Requires: %{scl_runtime} +} +%description driver-core +The Java operations layer for the MongoDB Java Driver. Third +parties can wrap this layer to provide custom higher-level APIs + +%package driver-async +Summary: The MongoDB Java Async Driver +%{!?scl: +Requires: javapackages-tools +} +%{?scl: +Requires: %{scl_runtime} +} +%description driver-async +The MongoDB Asynchronous Driver. + +%prep +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +%setup -qn %{pkg_name}-r%{version} +%patch0 -p1 +find -name '*.class' -exec rm -f '{}' \; +find -name '*.jar' -exec rm -f '{}' \; +set -ex +%mvn_package org.mongodb:bson:* %{pkg_name}-bson +%mvn_package org.mongodb:%{pkg_name}:* %{pkg_name} +%mvn_package org.mongodb:mongodb-driver-core:* %{pkg_name}-driver-core +%mvn_package org.mongodb:mongodb-driver-async:* %{pkg_name}-driver-async +%mvn_package org.mongodb:mongodb-driver:* %{pkg_name}-driver +%mvn_package org.mongodb:mongodb-javadoc-utils:* __noinstall +%mvn_file org.mongodb:bson:* %{pkg_name}/bson +%mvn_file org.mongodb:%{pkg_name}:* %{pkg_name}/mongo +%mvn_file org.mongodb:mongodb-driver-core:* %{pkg_name}/driver-core +%mvn_file org.mongodb:mongodb-driver-async:* %{pkg_name}/driver-async +%mvn_file org.mongodb:mongodb-driver:* %{pkg_name}/driver +%{?scl:EOF} + +%build +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +%gradle_build -f -- -s -i +%{?scl:EOF} + +%install +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +%mvn_install +%{?scl:EOF} + +%files -f .mfiles-%{pkg_name} +%doc README.md LICENSE.txt + +%files bson -f .mfiles-%{pkg_name}-bson +%doc README.md LICENSE.txt + +%files driver -f .mfiles-%{pkg_name}-driver +%doc README.md LICENSE.txt + +%files driver-core -f .mfiles-%{pkg_name}-driver-core +%doc README.md LICENSE.txt + +%files driver-async -f .mfiles-%{pkg_name}-driver-async +%doc README.md LICENSE.txt + +%changelog +* Mon Aug 17 2020 Shaoqiang Kang - 3.6.4-1 +- Package init diff --git a/mongo-java-driver.yaml b/mongo-java-driver.yaml new file mode 100644 index 0000000..68156f9 --- /dev/null +++ b/mongo-java-driver.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: mongodb/mongo-java-driver +tag_prefix: "r" +seperator: "." diff --git a/r3.6.4.tar.gz b/r3.6.4.tar.gz new file mode 100644 index 0000000..8fc4488 Binary files /dev/null and b/r3.6.4.tar.gz differ