简体   繁体   English

Maven-在公共存储库中无法安装JAR(在Eclipse中)

[英]Maven - Installing JAR not available in public repositories (in Eclipse)

When I deploy a successfully build Maven Project, from Eclipse, to Tomcat: the application complains that the jar file is not found. 当我从Eclipse将成功构建的Maven项目部署到Tomcat时:应用程序抱怨找不到jar文件。

Steps taken: 采取的步骤:

1) Installed JAR in local Maven repository : 1)在本地Maven存储库中安装了JAR

mvn install:install-file -Dfile=xmlrpc-1.1.jar -DgroupId=org.apache -DartifactId=xmlrpc -Dversion=1.1 -Dpackaging=jar

2) Edited the POM file in Eclipse with: 2)使用以下命令在Eclipse中编辑POM文件:

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>xmlrpc</artifactId>
    <version>1.1</version>
</dependency>

3) Synchronized the Maven dependency to the build path of Eclipse: 3)将Maven依赖项同步到Eclipse的构建路径:

mvn eclipse:eclipse

Any tips on steps to take? 关于采取步骤的任何提示?

NB: I do not plan to make the jar available in a public repository; 注意:我不打算在公共资源库中提供jar。 as far as I know this particular jar file is not available from a public repository (class file required is: org/apache/xmlrpc/Base64). 据我所知,这个特定的jar文件无法从公共存储库中获得(所需的类文件为:org / apache / xmlrpc / Base64)。

Any tips on steps to take? 关于采取步骤的任何提示?

The steps 1), 2), 3) look corrects. 步骤1),2),3)看起来正确。 Did you refresh the project under eclipse after that? 之后,您是否在eclipse下刷新了项目? Do you see the library in the Eclipse classpath? 您是否在Eclipse类路径中看到该库? Is the JAR non empty? JAR是否为空?

Did you check if Maven packages the WAR correctly? 您是否检查过Maven是否正确打包了WAR? If yes (and that would be the expected result) then at least you'll know it's an Eclipse/Tomcat issue. 如果是(这将是预期的结果),那么至少您会知道这是Eclipse / Tomcat问题。

NB: I do not plan to make the jar available in a public repository; 注意:我不打算在公共资源库中提供jar。 as far as I know this particular jar file is not available from a public repository (class file required is: org/apache/xmlrpc/Base64). 据我所知,这个特定的jar文件无法从公共存储库中获得(所需的类文件为:org / apache / xmlrpc / Base64)。

Old versions of this artifact like xmlrpc-1.1.jar are available in the repository using the groupId xmlrpc : 该仓库中的旧版本(例如xmlrpc-1.1.jar可以使用groupId xmlrpc在存储库中提供:

<dependency>
  <groupId>xmlrpc</groupId>
  <artifactId>xmlrpc</artifactId>
  <version>1.1</version>
</dependency>

More recent versions like xmlrpc-3.0.x.jar are available using the groupId org.apache.xmlrpc . 使用groupId org.apache.xmlrpc可获得诸如xmlrpc-3.0.x.jar类的最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM