Skip to content

Commit

Permalink
Migrate to new mavengem
Browse files Browse the repository at this point in the history
Mavengem has used the v1/dependencies API on rubygems.org to get
gem information, but that API has now gone away (whitelisted for
us until August 8). This change migrates to a newer version of
mavengem that uses newer APIs to make up the same functionality.

See jruby/mavengem#9
  • Loading branch information
headius committed Aug 10, 2023
1 parent 2c2f456 commit f976615
Show file tree
Hide file tree
Showing 32 changed files with 60 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<extension>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.4.7</version>
<version>0.4.11-SNAPSHOT</version>
</extension>
</extensions>
6 changes: 3 additions & 3 deletions lib/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def log(message=nil)

properties( 'polyglot.dump.pom' => 'pom.xml',
'polyglot.dump.readonly' => true,
'jruby.plugins.version' => '1.1.2',
'jruby.plugins.version' => '3.0.0',
'gem.home' => '${basedir}/ruby/gems/shared',
# we copy everything into the target/classes/META-INF
# so the jar plugin just packs it - see build/resources below
Expand All @@ -82,7 +82,7 @@ def log(message=nil)
# just depends on jruby-core so we are sure the jruby.jar is in place
jar "org.jruby:jruby-core:#{version}", :scope => 'test'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'

repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

Expand Down Expand Up @@ -177,7 +177,7 @@ def log(message=nil)
ghome = default_gemnames.member?( a.artifact_id ) ? gem_home : jruby_gems
if Dir[ File.join( ghome, 'cache', File.basename( a.file.to_pathname ).sub( /.gem/, '*.gem' ) ) ].empty?
log a.file.to_pathname
installer = Gem::Installer.new( a.file.to_pathname,
installer = Gem::Installer.new( Gem::Package.new(a.file.to_pathname),
wrappers: true,
ignore_dependencies: true,
install_dir: ghome,
Expand Down
10 changes: 5 additions & 5 deletions lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DO NOT MODIFY - GENERATED CODE
<gem.home>${basedir}/ruby/gems/shared</gem.home>
<jruby.complete.gems>${jruby.complete.home}/lib/ruby/gems/shared</jruby.complete.gems>
<jruby.complete.home>${project.build.outputDirectory}/META-INF/jruby.home</jruby.complete.home>
<jruby.plugins.version>1.1.2</jruby.plugins.version>
<jruby.plugins.version>3.0.0</jruby.plugins.version>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<polyglot.dump.readonly>true</polyglot.dump.readonly>
</properties>
Expand Down Expand Up @@ -548,9 +548,9 @@ DO NOT MODIFY - GENERATED CODE
<build>
<extensions>
<extension>
<groupId>org.torquebox.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>mavengem-wagon</artifactId>
<version>1.0.3</version>
<version>2.0.0</version>
</extension>
</extensions>
<resources>
Expand Down Expand Up @@ -757,7 +757,7 @@ DO NOT MODIFY - GENERATED CODE
<plugin>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-maven-plugin</artifactId>
<version>0.4.7</version>
<version>0.4.11-SNAPSHOT</version>
<executions>
<execution>
<id>install_gems</id>
Expand Down Expand Up @@ -808,7 +808,7 @@ DO NOT MODIFY - GENERATED CODE
<dependency>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.4.7</version>
<version>0.4.11-SNAPSHOT</version>
</dependency>
</dependencies>
<inherited>false</inherited>
Expand Down
8 changes: 4 additions & 4 deletions lifecycle-mapping-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>de.saumya.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>gem-maven-plugin</artifactId>
<versionRange>1.0.0-rc</versionRange>
<versionRange>3.0.0</versionRange>
<goals>
<goal>initialize</goal>
</goals>
Expand All @@ -42,9 +42,9 @@
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>de.saumya.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>gem-maven-plugin</artifactId>
<versionRange>1.0.0-rc2</versionRange>
<versionRange>3.0.0</versionRange>
<goals>
<goal>initialize</goal>
</goals>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-complete/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
packaging 'bundle'


extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'

plugin_repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<build>
<extensions>
<extension>
<groupId>org.torquebox.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>mavengem-wagon</artifactId>
<version>1.0.3</version>
<version>2.0.0</version>
</extension>
</extensions>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-complete/src/it/extended/Mavenfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-*- mode: ruby -*-

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8',
'jruby.home' => '${basedir}/../../../../..' )

Expand Down
6 changes: 3 additions & 3 deletions maven/jruby-complete/src/it/runnable/Mavenfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#-*- mode: ruby -*-

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
'mavengem.wagon.version' => '1.0.3',
'jruby.version' => '9.0.5.0' )
properties( 'jruby.plugins.version' => '3.0.0',
'mavengem.wagon.version' => '2.0.0',
'jruby.version' => '9.4.3.0' )

gemfile

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

model.repositories.clear

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

id 'org.jruby.osgi:gems-bundle', '1.0'

packaging 'bundle'

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
# needed bundle plugin
'polyglot.dump.pom' => 'pom.xml' )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
packaging :pom

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8' )

modules [ 'gems-bundle', 'scripts-bundle', 'test' ]
2 changes: 1 addition & 1 deletion maven/jruby-jars/Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end

properties( 'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readonly' => true,
'jruby.plugins.version' => '1.1.8',
'jruby.plugins.version' => '3.0.0',
# we share the already installed gems
'gem.home' => '${jruby_home}/lib/ruby/gems/shared',
# need jruby_home but not jruby.home as name otherwise
Expand Down
7 changes: 2 additions & 5 deletions maven/jruby-jars/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>1.0.5</version>
<version>3.0.0</version>
<executions>
<execution>
<goals><goal>initialize</goal></goals>
</execution>
</executions>
<configuration>
<jrubyVersion>1.7.22</jrubyVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/j2ee_jetty/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
packaging 'war'

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8' )

pom( 'org.jruby:jruby', '${jruby.version}' )

# a gem to be used
gem 'flickraw', '0.9.7'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/j2ee_jetty_rack/Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
packaging 'war'

# get jruby dependencies
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8',
'public.dir' => '${basedir}/public' )

Expand All @@ -16,7 +16,7 @@ jar( 'org.jruby.rack:jruby-rack', '1.1.18',
# a gem to be used
gem 'flickraw', '0.9.7'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/j2ee_tomcat/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
packaging 'war'

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8' )

pom( 'org.jruby:jruby', '${jruby.version}' )

# a gem to be used
gem 'flickraw', '0.9.7'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/j2ee_tomcat_rack/Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
packaging 'war'

# get jruby dependencies
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8',
'public.dir' => '${basedir}/public' )

Expand All @@ -16,7 +16,7 @@ jar( 'org.jruby.rack:jruby-rack', '1.1.18',
# a gem to be used
gem 'flickraw', '0.9.7'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/j2ee_wildfly/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
packaging 'war'

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'wildfly.version' => '9.0.2.Final',
'project.build.sourceEncoding' => 'utf-8' )

Expand All @@ -11,7 +11,7 @@
# a gem to be used
gem 'virtus', '0.5.5'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
4 changes: 2 additions & 2 deletions maven/jruby/src/it/jetty/Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
packaging 'war'

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10',
properties( 'jruby.plugins.version' => '3.0.0',
'project.build.sourceEncoding' => 'utf-8',
'public.dir' => '${basedir}/public' )

Expand All @@ -16,7 +16,7 @@ jar( 'org.jruby.rack:jruby-rack', '1.1.14',
# a gem to be used
gem 'flickraw', '0.9.7'

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

jruby_plugin :gem, :includeRubygemsInTestResources => false, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true, :jrubyVersion => '9.0.0.0' do
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby/src/it/many_jars_with_embedded_gems/app/pom.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# two jars with embedded gems
jar 'de.saumya.mojo:maven-tools', '1.0.0.rc1'
jar 'org.jruby.maven:maven-tools', '3.0.0'
jar 'org.rubygems:zip', '2.0.2'

# jruby scripting container
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby/src/it/many_jars_with_embedded_gems/pom.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-*- mode: ruby -*-

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10' )
properties( 'jruby.plugins.version' => '3.0.0' )

packaging :pom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

model.repositories.clear

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

id 'org.rubygems:zip', VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

model.repositories.clear

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

id 'org.rubygems:gem1', '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

model.repositories.clear

extension 'org.torquebox.mojo:mavengem-wagon:1.0.3'
extension 'org.jruby.maven:mavengem-wagon:2.0.0'
repository :id => :mavengems, :url => 'mavengem:https://rubygems.org'

id 'org.rubygems:gem2', '2'
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby/src/it/many_jars_with_embedded_gems_ng/pom.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-*- mode: ruby -*-

# default versions will be overwritten by pom.rb from root directory
properties( 'jruby.plugins.version' => '1.0.10' )
properties( 'jruby.plugins.version' => '3.0.0' )

packaging :pom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,28 @@
</repositories>

<properties>
<jruby.plugins.version>1.0.10</jruby.plugins.version>
<jruby.plugins.version>>3.0.0</jruby.plugins.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<extensions>
<extension>
<groupId>org.torquebox.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>mavengem-wagon</artifactId>
<version>1.0.3</version>
<version>2.0.0</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<groupId>org.jruby.maven</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version>
<executions>
<execution>
<goals><goal>initialize</goal></goals>
</execution>
</executions>
<configuration>
<jrubyVersion>1.7.22</jrubyVersion>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit f976615

Please sign in to comment.