From a180398ea55f7c0ad6c7ba458f58366ca8a9863b Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 10 Dec 2024 22:43:37 -0600 Subject: [PATCH 1/3] Minimum Java 8 target throughout --- .../src/it/assemble-project-without-gems/application/pom.xml | 4 ++-- .../src/it/assemble-project-without-gems/java-world/pom.xml | 4 ++-- gem-maven-plugin/src/it/gemify-pom/pom.xml | 4 ++++ gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml | 4 ++++ .../src/it/include-rubygems-in-test-resources/pom.xml | 4 ++-- gem-maven-plugin/src/it/small-project/java-world/pom.xml | 4 ++++ .../org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom | 4 ++-- .../repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom | 4 ++-- 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/pom.xml b/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/pom.xml index db9be552..ca8a8e3f 100644 --- a/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/pom.xml +++ b/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/pom.xml @@ -43,8 +43,8 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 + 8 + 8 diff --git a/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/pom.xml b/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/pom.xml index 5b2420f6..82403976 100644 --- a/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/pom.xml +++ b/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/pom.xml @@ -12,8 +12,8 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 + 8 + 8 diff --git a/gem-maven-plugin/src/it/gemify-pom/pom.xml b/gem-maven-plugin/src/it/gemify-pom/pom.xml index d4e27abf..d7da80b3 100644 --- a/gem-maven-plugin/src/it/gemify-pom/pom.xml +++ b/gem-maven-plugin/src/it/gemify-pom/pom.xml @@ -25,6 +25,10 @@ maven-compiler-plugin 3.8.1 + + 8 + 8 + diff --git a/gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml b/gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml index 92be80d1..79113a5b 100644 --- a/gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml +++ b/gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml @@ -80,6 +80,10 @@ maven-compiler-plugin 3.8.1 + + 8 + 8 + diff --git a/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.xml b/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.xml index 8476008e..f2d347b2 100644 --- a/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.xml +++ b/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.xml @@ -60,8 +60,8 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 + 8 + 8 diff --git a/gem-maven-plugin/src/it/small-project/java-world/pom.xml b/gem-maven-plugin/src/it/small-project/java-world/pom.xml index 05c9578f..4405d738 100644 --- a/gem-maven-plugin/src/it/small-project/java-world/pom.xml +++ b/gem-maven-plugin/src/it/small-project/java-world/pom.xml @@ -11,6 +11,10 @@ maven-compiler-plugin 3.8.1 + + 8 + 8 + diff --git a/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom b/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom index 49b985aa..5f6d27f6 100644 --- a/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom +++ b/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom @@ -39,8 +39,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.2 - 1.2 + 8 + 8 org/apache/tools/ant/launch/*.java diff --git a/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom b/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom index 52e59f00..df1b39eb 100644 --- a/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom +++ b/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom @@ -111,8 +111,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.2 - 1.2 + 8 + 8 org/apache/tools/ant/taskdefs/optional/** org/apache/tools/ant/filters/util/JavaClassHelper* From 0178275083a50a0769ffcb4b0e8973ea1834ffe6 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 10 Dec 2024 22:44:04 -0600 Subject: [PATCH 2/3] Update some plugins to get build working This may have been due to building with Java 21, newer Maven, or something else. --- .../src/it/assemble-project-with-gems/application/pom.xml | 4 ++-- parent-mojo/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/pom.xml b/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/pom.xml index ff656785..e3e8fa8c 100644 --- a/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/pom.xml +++ b/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/pom.xml @@ -56,7 +56,7 @@ maven-assembly-plugin - 2.2-beta-5 + 3.7.1 jar-with-dependencies-and-gems @@ -71,7 +71,7 @@ package - assembly + single diff --git a/parent-mojo/pom.xml b/parent-mojo/pom.xml index d8fc4a88..0123879e 100644 --- a/parent-mojo/pom.xml +++ b/parent-mojo/pom.xml @@ -50,7 +50,7 @@ maven-source-plugin - 2.4 + 3.2.1 jar diff --git a/pom.xml b/pom.xml index 076a268e..51efa509 100644 --- a/pom.xml +++ b/pom.xml @@ -140,7 +140,7 @@ maven-jar-plugin - 2.3 + 3.4.1 maven-dependency-plugin From 6e51482825471b65a6df7f87eb8abf6bc17a39f1 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 10 Dec 2024 22:44:39 -0600 Subject: [PATCH 3/3] File.exists? no longer exist? --- .../src/main/java/de/saumya/mojo/bundler/InstallMojo.java | 2 +- .../src/main/java/de/saumya/mojo/gem/PackageMojo.java | 2 +- ruby-tools/src/main/scripts/install_gems.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/InstallMojo.java b/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/InstallMojo.java index c46bf397..9e1b1054 100644 --- a/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/InstallMojo.java +++ b/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/InstallMojo.java @@ -327,7 +327,7 @@ public String toString(){ } private void getHistoryLogScript(RubyStringBuilder builder) { builder.appendLine("log = File.join('log', 'history.log')"); - builder.appendLine("if File.exists? File.dirname(log)"); + builder.appendLine("if File.exist? File.dirname(log)"); builder.appendLine(" File.open(log, 'a') do |f|"); builder.appendLine(" f.puts \"#{$0.sub(/.*\\//, '')} #{ARGV.join ' '}\""); builder.appendLine(" end"); diff --git a/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java b/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java index 31ef7dca..b20bf84d 100644 --- a/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java +++ b/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java @@ -370,7 +370,7 @@ else if ((Artifact.SCOPE_PROVIDED + Artifact.SCOPE_TEST).contains(dependency.get writer.append("end\n"); writer.append("\n"); writer.append("load File.dirname(__FILE__) + '/" + this.gemHook - + "' if File.exists?( File.dirname(__FILE__) + '/" + + "' if File.exist?( File.dirname(__FILE__) + '/" + this.gemHook + "')\n"); } catch (final IOException e) { diff --git a/ruby-tools/src/main/scripts/install_gems.rb b/ruby-tools/src/main/scripts/install_gems.rb index 9bfb64bb..b654f527 100644 --- a/ruby-tools/src/main/scripts/install_gems.rb +++ b/ruby-tools/src/main/scripts/install_gems.rb @@ -10,7 +10,7 @@ Dir[ 'target/dependency/*gem' ].each do |file| f = "../target/rubygems/gems/#{File.basename(file).sub(/.gem/, '')}/lib" - unless File.exists?( f ) + unless File.exist?( f ) f = "../target/rubygems/gems/#{File.basename(file).sub(/.gem/, '')}-java/lib" end Dir[ File.expand_path( f ) + "/*" ].each do |ff|