diff --git a/0001-Interpolate-properties-also-in-the-current-artifact.patch b/0005-Interpolate-properties-also-in-the-current-artifact.patch similarity index 97% rename from 0001-Interpolate-properties-also-in-the-current-artifact.patch rename to 0005-Interpolate-properties-also-in-the-current-artifact.patch index c4cfe8b..2554137 100644 --- a/0001-Interpolate-properties-also-in-the-current-artifact.patch +++ b/0005-Interpolate-properties-also-in-the-current-artifact.patch @@ -1,7 +1,7 @@ From d458bce49270bccfa40e9c4e288b3c9550aff741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Wed, 4 Oct 2023 04:07:58 +0200 -Subject: [PATCH] Interpolate properties also in the current artifact +Subject: [PATCH 5/5] Interpolate properties also in the current artifact --- java-utils/install_pom.py | 15 +++++++++------ diff --git a/0006-Test-variable-expansion-in-artifactId.patch b/0006-Test-variable-expansion-in-artifactId.patch new file mode 100644 index 0000000..8c74802 --- /dev/null +++ b/0006-Test-variable-expansion-in-artifactId.patch @@ -0,0 +1,713 @@ +From ce0929d03ba33ff98727fbd527f4ec94412f78bd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Wed, 4 Oct 2023 08:26:00 +0200 +Subject: [PATCH 6/7] Test variable expansion in artifactId + +--- + .../test_artifactid_expansion-want.xml | 34 ++ + test/data/install_pom/xgboost/pom.xml | 499 ++++++++++++++++++ + .../install_pom/xgboost/xgboost4j/pom.xml | 125 +++++ + test/install_pom_test.py | 7 + + 4 files changed, 665 insertions(+) + create mode 100644 test/data/install_pom/test_artifactid_expansion-want.xml + create mode 100644 test/data/install_pom/xgboost/pom.xml + create mode 100644 test/data/install_pom/xgboost/xgboost4j/pom.xml + +diff --git a/test/data/install_pom/test_artifactid_expansion-want.xml b/test/data/install_pom/test_artifactid_expansion-want.xml +new file mode 100644 +index 00000000..ce5fdcf8 +--- /dev/null ++++ b/test/data/install_pom/test_artifactid_expansion-want.xml +@@ -0,0 +1,34 @@ ++ ++ ++ 4.0.0 ++ ml.dmlc ++ xgboost4j_2.12 ++ 2.0.0 ++ ++ ++ org.scala-lang ++ scala-compiler ++ 2.12.18 ++ ++ ++ org.scala-lang ++ scala-library ++ 2.12.18 ++ ++ ++ org.scala-lang.modules ++ scala-collection-compat_2.12 ++ 2.10.0 ++ ++ ++ com.esotericsoftware ++ kryo ++ 5.5.0 ++ ++ ++ commons-logging ++ commons-logging ++ 1.2 ++ ++ ++ +\ No newline at end of file +diff --git a/test/data/install_pom/xgboost/pom.xml b/test/data/install_pom/xgboost/pom.xml +new file mode 100644 +index 00000000..80caa132 +--- /dev/null ++++ b/test/data/install_pom/xgboost/pom.xml +@@ -0,0 +1,499 @@ ++ ++ ++ 4.0.0 ++ ++ ml.dmlc ++ xgboost-jvm ++ 2.0.0 ++ pom ++ XGBoost JVM Package ++ JVM Package for XGBoost ++ https://github.com/dmlc/xgboost/tree/master/jvm-packages ++ ++ ++ The Apache License, Version 2.0 ++ http://www.apache.org/licenses/LICENSE-2.0.txt ++ ++ ++ ++ ++ CodingCat ++ codingcat@apache.org ++ ++ ++ ++ scm:git:git:/github.com/dmlc/xgboost.git ++ scm:git:ssh://github.com/dmlc/xgboost.git ++ https://github.com/dmlc/xgboost ++ ++ ++ UTF-8 ++ UTF-8 ++ 1.8 ++ 1.8 ++ 1.17.1 ++ 4.13.2 ++ 3.4.0 ++ 3.3.2 ++ 2.12.18 ++ 2.12 ++ 3.3.5 ++ 5 ++ OFF ++ OFF ++ 23.08.0 ++ 23.08.0 ++ cuda11 ++ 3.2.16 ++ 2.10.0 ++ ++ ++ ++ central_maven ++ central maven ++ https://repo1.maven.org/maven2 ++ ++ ++ ++ ++ ++ ++ ++ ++ default ++ ++ true ++ ++ ++ xgboost4j ++ xgboost4j-example ++ xgboost4j-spark ++ xgboost4j-flink ++ ++ ++ ++ ++ scala-2.13 ++ ++ 2.13 ++ 2.13.11 ++ ++ ++ ++ ++ ++ gpu ++ ++ ++ use.cuda ++ ON ++ ++ ++ ++ ON ++ ++ ++ xgboost4j-gpu ++ xgboost4j-spark-gpu ++ ++ ++ ++ ++ release ++ ++ xgboost4j ++ xgboost4j-example ++ xgboost4j-spark ++ xgboost4j-flink ++ xgboost4j-gpu ++ xgboost4j-spark-gpu ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ ++ ++ empty-javadoc-jar ++ package ++ ++ jar ++ ++ ++ javadoc ++ ${basedir}/javadoc ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-release-plugin ++ 3.0.1 ++ ++ true ++ false ++ release ++ deploy ++ ++ ++ ++ org.apache.maven.plugins ++ maven-gpg-plugin ++ 3.1.0 ++ ++ ++ sign-artifacts ++ verify ++ ++ sign ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-source-plugin ++ 3.3.0 ++ ++ ++ attach-sources ++ ++ jar-no-fork ++ ++ ++ ++ ++ ++ org.sonatype.plugins ++ nexus-staging-maven-plugin ++ 1.6.13 ++ true ++ ++ ossrh ++ https://oss.sonatype.org/ ++ false ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ ++ true ++ ++ ++ ++ ++ ++ ++ assembly ++ ++ ++ ++ org.apache.maven.plugins ++ maven-assembly-plugin ++ 3.6.0 ++ ++ ++ jar-with-dependencies ++ ++ true ++ ++ ++ ++ make-assembly ++ package ++ ++ single ++ ++ ++ ++ ++ ++ ++ ++ ++ release-to-github ++ ++ ++ github.repo ++ Temporary Staging Repository ++ file://${project.build.directory}/mvn-repo ++ ++ ++ ++ github ++ ++ ++ xgboost4j ++ xgboost4j-example ++ xgboost4j-spark ++ xgboost4j-flink ++ xgboost4j-gpu ++ xgboost4j-spark-gpu ++ ++ ++ ++ ++ com.github.github ++ site-maven-plugin ++ 0.12 ++ ++ Maven artifacts for ${project.version} ++ true ++ ${project.build.directory}/mvn-repo ++ refs/heads/maven-repo ++ ++ *-with-dependencies.jar ++ ++ xgboost ++ CodingCat ++ true ++ ++ ++ ++ ++ ++ site ++ ++ deploy ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-deploy-plugin ++ 3.1.1 ++ ++ internal.repo::default::file://${project.build.directory}/mvn-repo ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ ++ true ++ ++ ++ ++ ++ ++ ++ release-to-s3 ++ ++ ++ maven-s3-snapshot-repo ++ s3://xgboost-maven-repo/snapshot ++ ++ ++ maven-s3-release-repo ++ s3://xgboost-maven-repo/release ++ ++ ++ ++ ++ maven-s3-snapshot-repo ++ https://s3.amazonaws.com/xgboost-maven-repo/snapshot ++ ++ ++ maven-s3-release-repo ++ https://s3.amazonaws.com/xgboost-maven-repo/release ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ ++ true ++ ++ ++ ++ ++ ++ ++ ++ ++ ossrh ++ https://oss.sonatype.org/content/repositories/snapshots ++ ++ ++ ++ ++ ++ src/main/resources ++ true ++ ++ ++ ++ ++ ++ ++ org.scalatest ++ scalatest-maven-plugin ++ 2.2.0 ++ ++ ++ test ++ ++ test ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ org.scalastyle ++ scalastyle-maven-plugin ++ 1.0.0 ++ ++ false ++ true ++ true ++ ${basedir}/src/main/scala ++ ${basedir}/src/test/scala ++ scalastyle-config.xml ++ UTF-8 ++ ++ ++ ++ checkstyle ++ validate ++ ++ check ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-site-plugin ++ 3.12.1 ++ ++ ++ org.apache.maven.plugins ++ maven-checkstyle-plugin ++ 3.3.0 ++ ++ checkstyle.xml ++ true ++ ++ ++ ++ checkstyle ++ validate ++ ++ check ++ ++ ++ ++ ++ ++ net.alchim31.maven ++ scala-maven-plugin ++ 4.8.1 ++ ++ ++ compile ++ ++ compile ++ ++ compile ++ ++ ++ test-compile ++ ++ testCompile ++ ++ test-compile ++ ++ ++ process-resources ++ ++ compile ++ ++ ++ ++ scala-compile-first ++ process-resources ++ ++ compile ++ add-source ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ 3.1.2 ++ ++ false ++ false ++ ++ ++ ++ org.scalatest ++ scalatest-maven-plugin ++ ++ ++ ++ ++ com.github.seahen ++ maven-s3-wagon ++ 1.3.3 ++ ++ ++ ++ ++ ++ ++ maven-project-info-reports-plugin ++ 3.4.5 ++ ++ ++ net.alchim31.maven ++ scala-maven-plugin ++ 4.8.1 ++ ++ ++ -Xms64m ++ -Xmx1024m ++ ++ ++ ++ ++ ++ ++ ++ com.esotericsoftware ++ kryo ++ 5.5.0 ++ ++ ++ commons-logging ++ commons-logging ++ 1.2 ++ ++ ++ org.scalatest ++ scalatest_${scala.binary.version} ++ ${scalatest.version} ++ test ++ ++ ++ org.scalactic ++ scalactic_${scala.binary.version} ++ ${scalatest.version} ++ test ++ ++ ++ +diff --git a/test/data/install_pom/xgboost/xgboost4j/pom.xml b/test/data/install_pom/xgboost/xgboost4j/pom.xml +new file mode 100644 +index 00000000..8d4f2c05 +--- /dev/null ++++ b/test/data/install_pom/xgboost/xgboost4j/pom.xml +@@ -0,0 +1,125 @@ ++ ++ ++ 4.0.0 ++ ++ ml.dmlc ++ xgboost-jvm ++ 2.0.0 ++ ++ xgboost4j ++ xgboost4j_${scala.binary.version} ++ 2.0.0 ++ jar ++ ++ ++ ++ org.scala-lang ++ scala-compiler ++ ${scala.version} ++ ++ ++ org.scala-lang ++ scala-library ++ ${scala.version} ++ ++ ++ org.scala-lang.modules ++ scala-collection-compat_${scala.binary.version} ++ ${scala-collection-compat.version} ++ ++ ++ org.apache.hadoop ++ hadoop-hdfs ++ ${hadoop.version} ++ provided ++ ++ ++ org.apache.hadoop ++ hadoop-common ++ ${hadoop.version} ++ provided ++ ++ ++ junit ++ junit ++ ${junit.version} ++ test ++ ++ ++ org.scalatest ++ scalatest_${scala.binary.version} ++ ${scalatest.version} ++ provided ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-javadoc-plugin ++ 3.5.0 ++ ++ protected ++ true ++ ++ ++ ++ org.apache.maven.plugins ++ maven-assembly-plugin ++ ++ false ++ ++ ++ ++ exec-maven-plugin ++ org.codehaus.mojo ++ 3.1.0 ++ ++ ++ native ++ generate-sources ++ ++ exec ++ ++ ++ python ++ ++ create_jni.py ++ --log-capi-invocation ++ ${log.capi.invocation} ++ ++ ${user.dir} ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-jar-plugin ++ 3.3.0 ++ ++ ++ ++ test-jar ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-resources-plugin ++ 3.3.1 ++ ++ ++ dll ++ dylib ++ so ++ ++ ++ ++ ++ ++ +diff --git a/test/install_pom_test.py b/test/install_pom_test.py +index c6acc644..db79c001 100644 +--- a/test/install_pom_test.py ++++ b/test/install_pom_test.py +@@ -131,6 +131,13 @@ class TestInstallPom(unittest.TestCase): + result) + self.assertEqual(report, '', report) + ++ @install_pom(os.path.join('xgboost', 'xgboost4j', 'pom.xml')) ++ def test_artifactid_expansion(self, stdout, stderr, return_value, result): ++ self.assertEqual(return_value, 0, stderr) ++ report = self.check_result(inspect.currentframe().f_code.co_name, ++ result) ++ self.assertEqual(report, '', report) ++ + @install_pom('a_binary_file.pom') + def test_not_pom(self, stdout, stderr, return_value, result): + self.assertNotEqual(return_value, 0) +-- +2.42.0 + diff --git a/0007-Test-that-we-don-t-bomb-on-relativePath.patch b/0007-Test-that-we-don-t-bomb-on-relativePath.patch new file mode 100644 index 0000000..3793b9a --- /dev/null +++ b/0007-Test-that-we-don-t-bomb-on-relativePath.patch @@ -0,0 +1,268 @@ +From 3a32ce8695f891d8051cccd5273758d3cd9ce54c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Wed, 4 Oct 2023 08:32:33 +0200 +Subject: [PATCH 7/7] Test that we don't bomb on + +--- + test/data/install_pom/empty_relpath.pom | 182 ++++++++++++++++++ + .../install_pom/test_empty_relpath-want.xml | 39 ++++ + test/install_pom_test.py | 7 + + 3 files changed, 228 insertions(+) + create mode 100644 test/data/install_pom/empty_relpath.pom + create mode 100644 test/data/install_pom/test_empty_relpath-want.xml + +diff --git a/test/data/install_pom/empty_relpath.pom b/test/data/install_pom/empty_relpath.pom +new file mode 100644 +index 00000000..785b9710 +--- /dev/null ++++ b/test/data/install_pom/empty_relpath.pom +@@ -0,0 +1,182 @@ ++ ++ ++ ++ 4.0.0 ++ ++ ++ org.apache.maven.shared ++ maven-shared-components ++ 39 ++ ++ ++ ++ maven-filtering ++ 3.3.1 ++ ++ Apache Maven Filtering ++ A component to assist in filtering of resource files with properties from a Maven project. ++ ++ ++ ++ Graham Leggett ++ ++ ++ ++ ++ scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git ++ scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git ++ maven-filtering-3.3.1 ++ https://github.com/apache/maven-filtering/tree/${project.scm.tag} ++ ++ ++ JIRA ++ https://issues.apache.org/jira/issues/?jql=project%20%3D%20MSHARED%20AND%20component%20%3D%20maven-filtering ++ ++ ++ Jenkins ++ https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-filtering/ ++ ++ ++ ++ apache.website ++ scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path} ++ ++ ++ ++ ++ 8 ++ 3.2.5 ++ 1.7.36 ++ 0.0.7 ++ 2023-03-21T10:53:39Z ++ ++ ++ ++ ++ javax.inject ++ javax.inject ++ 1 ++ ++ ++ org.slf4j ++ slf4j-api ++ ${slf4jVersion} ++ ++ ++ org.sonatype.plexus ++ plexus-build-api ++ ${plexusBuildApiVersion} ++ ++ ++ org.apache.maven ++ maven-core ++ ${mavenVersion} ++ provided ++ ++ ++ org.apache.maven ++ maven-model ++ ${mavenVersion} ++ provided ++ ++ ++ org.apache.maven ++ maven-settings ++ ${mavenVersion} ++ provided ++ ++ ++ org.codehaus.plexus ++ plexus-utils ++ 3.5.1 ++ ++ ++ org.codehaus.plexus ++ plexus-interpolation ++ 1.26 ++ ++ ++ commons-io ++ commons-io ++ 2.11.0 ++ ++ ++ ++ org.mockito ++ mockito-core ++ 4.7.0 ++ test ++ ++ ++ junit ++ junit ++ 4.13.2 ++ test ++ ++ ++ org.hamcrest ++ hamcrest-core ++ 2.2 ++ test ++ ++ ++ org.slf4j ++ slf4j-simple ++ ${slf4jVersion} ++ test ++ ++ ++ org.sonatype.plexus ++ plexus-build-api ++ ${plexusBuildApiVersion} ++ tests ++ test ++ ++ ++ org.eclipse.sisu ++ org.eclipse.sisu.plexus ++ test ++ ++ ++ org.eclipse.sisu ++ org.eclipse.sisu.inject ++ test ++ ++ ++ ++ ++ ++ ++ ++ org.apache.rat ++ apache-rat-plugin ++ ++ ++ src/test/units-files/** ++ ++ ++ ++ ++ org.eclipse.sisu ++ sisu-maven-plugin ++ ++ ++ ++ +diff --git a/test/data/install_pom/test_empty_relpath-want.xml b/test/data/install_pom/test_empty_relpath-want.xml +new file mode 100644 +index 00000000..03bd1115 +--- /dev/null ++++ b/test/data/install_pom/test_empty_relpath-want.xml +@@ -0,0 +1,39 @@ ++ ++ ++ 4.0.0 ++ org.apache.maven.shared ++ maven-filtering ++ 3.3.1 ++ ++ ++ javax.inject ++ javax.inject ++ 1 ++ ++ ++ org.slf4j ++ slf4j-api ++ 1.7.36 ++ ++ ++ org.sonatype.plexus ++ plexus-build-api ++ 0.0.7 ++ ++ ++ org.codehaus.plexus ++ plexus-utils ++ 3.5.1 ++ ++ ++ org.codehaus.plexus ++ plexus-interpolation ++ 1.26 ++ ++ ++ commons-io ++ commons-io ++ 2.11.0 ++ ++ ++ +\ No newline at end of file +diff --git a/test/install_pom_test.py b/test/install_pom_test.py +index db79c001..a39f3aa4 100644 +--- a/test/install_pom_test.py ++++ b/test/install_pom_test.py +@@ -103,6 +103,13 @@ class TestInstallPom(unittest.TestCase): + result) + self.assertEqual(report, '', report) + ++ @install_pom('empty_relpath.pom') ++ def test_empty_relpath(self, stdout, stderr, return_value, result): ++ self.assertEqual(return_value, 0, stderr) ++ report = self.check_result(inspect.currentframe().f_code.co_name, ++ result) ++ self.assertEqual(report, '', report) ++ + @install_pom(os.path.join('xmvn', 'xmvn-tools', 'xmvn-install', 'pom.xml')) + def test_parent_chain(self, stdout, stderr, return_value, result): + self.assertEqual(return_value, 0, stderr) +-- +2.42.0 + diff --git a/javapackages-tools.changes b/javapackages-tools.changes index fcc13dc..d268579 100644 --- a/javapackages-tools.changes +++ b/javapackages-tools.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Oct 4 07:18:58 UTC 2023 - Fridrich Strba + +- Added patches: + * 0005-Interpolate-properties-also-in-the-current-artifact.patch + + interpolate variables also in current artifactId, groupId and + version + * 0006-Test-variable-expansion-in-artifactId.patch + + test previous changes + * 0007-Test-that-we-don-t-bomb-on-relativePath.patch + + test gracious handling of empty in parent + reference of a pom file + ------------------------------------------------------------------- Wed Sep 13 13:52:00 UTC 2023 - Fridrich Strba diff --git a/javapackages-tools.spec b/javapackages-tools.spec index e13c857..fe20e89 100644 --- a/javapackages-tools.spec +++ b/javapackages-tools.spec @@ -53,7 +53,12 @@ Patch4: 0002-Do-not-bomb-on-relativePath-construct.patch Patch5: 0003-Reproducible-exclusions-order-in-maven-metadata.patch #PATCH-FIX-UPSTREAM: make the aliases and dependencies lists so that the order is kept Patch6: 0004-Reproducible-builds-keep-order-of-aliases-and-depend.patch -Patch7: 0001-Interpolate-properties-also-in-the-current-artifact.patch +#PATCH-FIX-UPSTREAM: substitute variables like _${scala.binary.version} in artifact coordinates +Patch7: 0005-Interpolate-properties-also-in-the-current-artifact.patch +#PATCH-FIX-UPSTREAM: test changes from previous patch +Patch8: 0006-Test-variable-expansion-in-artifactId.patch +#PATCH-FIX-UPSTREAM: test gracious handling of construct +Patch9: 0007-Test-that-we-don-t-bomb-on-relativePath.patch BuildRequires: asciidoc BuildRequires: fdupes BuildRequires: perl