Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds compatibility to install gems with jruby > 9.2.10.x #106

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ target
tmp
*Backup
release.properties
.idea/
*.iml
2 changes: 1 addition & 1 deletion bundler-maven-plugin/src/it/bundler-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "Gemfile.lock" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-simplest-1.6.5--1.8.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}

file = new File( basedir, "target/summary.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import java.io.*;
import java.util.*;
import org.codehaus.plexus.util.FileUtils;


String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "Successfully installed compass-";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "Successfully installed sass-";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "Individual stylesheets must be in the sass directory.";
if ( !log.contains( expected ) )

String installMessage = "Successfully installed ";
String[] expectedGems = new String[] { "compass-", "sass-", "rb-inotify-" };

for ( String expectedGem: expectedGems )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
String expected = installMessage + expectedGem;
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
}
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/gemfile-to-pom-forced/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "pom.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
if ( f.lastModified() < new File( basedir, "timestamp" ).lastModified())
{
Expand Down
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/gemfile-to-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "pom.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/gemspec-to-pom-forced/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "pom.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
if ( f.lastModified() < new File( basedir, "timestamp" ).lastModified())
{
Expand Down
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/gemspec-to-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "pom.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>target/rubygems-in-test-resources</artifactId>
<artifactId>rubygems-in-test-resources-failure</artifactId>
<version>testing</version>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>yard</artifactId>
<version>0.8.0</version>
<artifactId>sass</artifactId>
<version>3.2.7</version>
<type>gem</type>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/install-gem-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "target/pom_first-0.0.0.gem" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>pom_first</artifactId>
<version>0.0.0</version>
<description>Installs a gem from http://rubygems.org with Ruby 2.7 compatibility</description>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a line which made me wonder: http vs https?

It's not recommended to request gems via http from rubygems.org.

Is there a special reason to not use https in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reason is legacy configuration. Right now it shows a warning but works, and I see there're other places where http is used that are not Java so not sure of the impact.
I am happy to work on it but I'd rather do it in a separated issue. wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate issue, totally right decision, and it's not a priority for me. Thanks for answering!

<properties>
<jruby.version>9.2.10.0</jruby.version>
</properties>
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>yard</artifactId>
<version>0.9.25</version>
<type>gem</type>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>org.torquebox.mojo</groupId>
<artifactId>mavengem-wagon</artifactId>
<version>1.0.3</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<jrubyVersion>${jruby.version}</jrubyVersion>
</configuration>
<executions>
<execution>
<id>install-gems</id>
<goals>
<goal>initialize</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>mavengems</id>
<url>mavengem:http://rubygems.org</url>
</repository>
</repositories>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.io.*;
import org.codehaus.plexus.util.FileUtils;

File f = new File( basedir, "target/rubygems/gems/yard-0.9.25" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion gem-maven-plugin/src/it/install-java-gem-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "target/com.example.package-java-gem-0.0.0-java.gem" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
4 changes: 2 additions & 2 deletions gem-maven-plugin/src/it/install-pom-with-gemspec/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "target/first.gem" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
f = new File( basedir, "pom.pom_first.gemspec.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
6 changes: 3 additions & 3 deletions gem-maven-plugin/src/it/jars-lock/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/jars/org/slf4j/log4j-over-slf4j/1.7.10/log4j-over-slf4j-1.7.10.jar" );
if ( !file.exists() )
{
throw new RuntimeException( "expected file does not exists '" + file + "'" );
throw new RuntimeException( "expected file does not exist '" + file + "'" );
}

file = new File( basedir, "target/jars/org/apache/kafka/kafka_2.10/0.8.1.1/kafka_2.10-0.8.1.1.jar" );
if ( !file.exists() )
{
throw new RuntimeException( "expected file does not exists '" + file + "'" );
throw new RuntimeException( "expected file does not exist '" + file + "'" );
}

file = new File( basedir, "target/jars/org/bouncycastle/bcprov-jdk15on/1.49/bcprov-jdk15on-1.49.jar" );
if ( !file.exists() )
{
throw new RuntimeException( "expected file does not exists '" + file + "'" );
throw new RuntimeException( "expected file does not exist '" + file + "'" );
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "gem_first-0.0.0.gem" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import org.codehaus.plexus.util.FileUtils;
File f = new File( basedir, "target/gem_first-0.0.0.gem" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion jruby-maven-plugin/src/it/compile-dir-156/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import java.io.*;
File target = new File(basedir, "target/classes");
for(String f: new String[] { "file.class", "more/hello.class" }){
if( !new File(target, f).exists() ){
throw new RuntimeException("file does not exists: target/classes" + f);
throw new RuntimeException("file does not exist: target/classes" + f);
}
}
2 changes: 1 addition & 1 deletion jruby-maven-plugin/src/it/compile-dir/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import java.io.*;
File target = new File(basedir, "target/classes");
for(String f: new String[] { "file.class", "more/hello.class" }){
if( !new File(target, f).exists() ){
throw new RuntimeException("file does not exists: target/classes" + f);
throw new RuntimeException("file does not exist: target/classes" + f);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import java.io.*;
File target = new File(basedir, "target/classes");
for(String f: new String[] { "com/example/Reply.class", "com/otherexample/MyReply.class" }){
if( !new File(target, f).exists() ){
throw new RuntimeException("file does not exists: target/classes/" + f);
throw new RuntimeException("file does not exist: target/classes/" + f);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import java.io.*;
File target = new File(basedir, "target/classes");
for(String f: new String[] { "com/example/Reply.class", "com/otherexample/MyReply.class" }){
if( !new File(target, f).exists() ){
throw new RuntimeException("file does not exists: target/classes/" + f);
throw new RuntimeException("file does not exist: target/classes/" + f);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ if ( !log.contains( expected ) )
File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-minispec-9.0.1.0.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}

f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-minispec-1.7.22--1.9.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
2 changes: 1 addition & 1 deletion minitest-maven-plugin/src/it/minitest-failure/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
2 changes: 1 addition & 1 deletion minitest-maven-plugin/src/it/minitest-pom-210/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
2 changes: 1 addition & 1 deletion minitest-maven-plugin/src/it/minitest-pom-508/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
2 changes: 1 addition & 1 deletion minitest-maven-plugin/src/it/minitest-somewhere/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if ( !log.contains( expected ) )
File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}

file = new File( basedir, "target/summary.xml");
if ( !file.exists() )
{
throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" );
throw new RuntimeException( "file does not exist: '" + file.getAbsolutePath() + "'" );
}
2 changes: 1 addition & 1 deletion parent-mojo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.5</version>
<version>3.0.1</version>
<configuration>
<projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
Expand Down
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-3.x/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ if ( !log.contains( expected ) )
File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-failure-19/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-failure/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if ( !log.contains( expected ) )
File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-pom/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ if ( !log.contains( expected ) )
File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" );
if ( !f.exists() )
{
throw new RuntimeException( "file does not exists: " + f );
throw new RuntimeException( "file does not exist: " + f );
}
Loading