Jruby- classloader的加载资源失败

发布于 2025-01-28 19:54:37 字数 823 浏览 4 评论 0原文

我正在使用插件gem-maven-plugin进行MVN install目标,请参见下面的pom.xml -

<plugin>
  <groupId>de.saumya.mojo</groupId>
  <artifactId>gem-maven-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>initialize</goal>
      </goals>
    </execution>
  </executions>
</plugin>

构建失败,并且错误消息:

[错误]无法执行目标de.saumya.mojo:gem-maven-plugin:2.0.1:initialize

由:java.io.filenotfoundexception引起:meta-inf/jruby.home/bin/gem

我正在使用Windows构建,但是该软件已从Linux移植。

文件路径meta-inf/jruby.home/bin/gem在我的系统上不存在(这是UNIX/Linux路径),是否有一种方法可以解决此错误?

Jruby版本:Jruby 9.1.2.0

OS:Windows Server 2012 R2

I am running a mvn install goal with the plugin gem-maven-plugin, see below pom.xml -

<plugin>
  <groupId>de.saumya.mojo</groupId>
  <artifactId>gem-maven-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>initialize</goal>
      </goals>
    </execution>
  </executions>
</plugin>

The build is failing with the error message:

[ERROR] Failed to execute goal de.saumya.mojo:gem-maven-plugin:2.0.1:initialize

Caused by: java.io.FileNotFoundException: loading resource from classloader failed: META-INF/jruby.home/bin/gem

I am building using Windows, but the software has been ported from Linux.

The file path META-INF/jruby.home/bin/gem does not exist on my system (it is a Unix/Linux path), is there a way to fix this error?

jRuby version: jruby 9.1.2.0

OS: Windows Server 2012 R2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

×眷恋的温暖 2025-02-04 19:54:37

这是由损坏的jruby .jar文件,从损坏的存储库中复制。

将来可能会帮助某人。

This was caused by a corrupted JRuby .jar file, copied from a corrupt repository.

Might help someone in the future.

淑女气质 2025-02-04 19:54:37

谢谢耶尔菲。你做到了。

在扩展Maven直接从Ruby存储库中下载Ruby Gems之后,我围绕它删除了本地存储库。

将以下片段添加到pom.xml:

<build>
    <extensions>
        <extension>
            <!-- Allows us to download Ruby gems -->
            <!-- See https://github.com/jruby/mavengem -->
            <groupId>org.torquebox.mojo</groupId>
            <artifactId>mavengem-wagon</artifactId>
            <version>1.0.3</version>
        </extension>
    </extensions>
    
     
  ********************************

  </build>
  
  ********************************
  <profiles>
  <profile>
        <repositories>
            <repository>
                <id>mavengems</id>
                <url>mavengem:https://rubygems.org</url>
            </repository>
        </repositories>
        <dependencies>
            <dependency>
                <groupId>rubygems</groupId>
                <artifactId>sass</artifactId>
                <version>${sass.version}</version>
                <type>gem</type>
            </dependency>
            <dependency>
                <groupId>rubygems</groupId>
                <artifactId>compass</artifactId>
                <version>${compass.version}</version>
                <type>gem</type>
            </dependency>
        </dependencies>
  </profile>
  </profiles>

Thank you Jelphy. You did.

I worked around it deleting my local repo after extending maven to download ruby gems directly from ruby repositories.

Add the following snippets to pom.xml:

<build>
    <extensions>
        <extension>
            <!-- Allows us to download Ruby gems -->
            <!-- See https://github.com/jruby/mavengem -->
            <groupId>org.torquebox.mojo</groupId>
            <artifactId>mavengem-wagon</artifactId>
            <version>1.0.3</version>
        </extension>
    </extensions>
    
     
  ********************************

  </build>
  
  ********************************
  <profiles>
  <profile>
        <repositories>
            <repository>
                <id>mavengems</id>
                <url>mavengem:https://rubygems.org</url>
            </repository>
        </repositories>
        <dependencies>
            <dependency>
                <groupId>rubygems</groupId>
                <artifactId>sass</artifactId>
                <version>${sass.version}</version>
                <type>gem</type>
            </dependency>
            <dependency>
                <groupId>rubygems</groupId>
                <artifactId>compass</artifactId>
                <version>${compass.version}</version>
                <type>gem</type>
            </dependency>
        </dependencies>
  </profile>
  </profiles>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文