英文:
Error while reading JAR from my Remote Repository [Dropbox as Maven Repository]
问题
以下是您要翻译的内容:
所以我按照这个教程创建了自己的Dropbox远程存储库。此外,我使用了以下命令将第三方JAR包部署到我的存储库。
> mvn deploy:deploy-file -DgroupId=com.prowritingaid.java -DartifactId=pro_writing_aid_java -Dversion=2.0.0 -Dpackaging=jar -Dfile=pro_writing_aid_java-2.0.0.jar -Durl=file:/home/de-10/Dropbox/ProWritingAid
部署成功,并且与Dropbox成功同步。但是现在,当我尝试通过pom.xml引用这些JAR包时,它不起作用。
我将Dropbox的URL添加到了我的存储库列表中:
<repository>
<id>ProWritingAid</id>
<name>Remote ProWritingAid Repository</name>
<url>https://www.dropbox.com/sh/fbv...</url>
</repository>
并且我已经像这样定义了依赖关系:
<!-- Keshavram Kuduwa的Dropbox存储库 -->
<dependency>
<groupId>com.prowritingaid.java</groupId>
<artifactId>pro_writing_aid_java</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Keshavram Kuduwa的Dropbox存储库 -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>2.7.5</version>
</dependency>
编译时的错误是:
> Description Resource Path Location Type
无法读取或不是有效的ZIP文件的项目'papertrue'中所需库的存档:'/home/de-10/.m2/repository/com/prowritingaid/java/pro_writing_aid_java/2.0.0/pro_writing_aid_java-2.0.0.jar' papertrue Build path Build Path Problem
但另一方面,当我使用以下命令在本地安装这些包时,它起作用:
> mvn install:install-file -DgroupId=com.prowritingaid.java -DartifactId=pro_writing_aid_java -Dversion=2.0.0 -Dpackaging=jar -Dfile=pro_writing_aid_java-2.0.0.jar
此外,如果我删除这些在本地安装的包并强制更新项目,错误会再次出现。我还替换了远程存储库中的JAR包,但没有帮助。
英文:
So I created my own remote repository with Dropbox following this tutorial. Further, I used the following command to deploy 3rd party JARS to my repository.
> mvn deploy:deploy-file -DgroupId=com.prowritingaid.java -DartifactId=pro_writing_aid_java -Dversion=2.0.0 -Dpackaging=jar -Dfile=pro_writing_aid_java-2.0.0.jar -Durl=file:/home/de-10/Dropbox/ProWritingAid
The deployment was successful and it successfully synchronised with Dropbox as well. But now when I try to refer to these jars via pom.xml, it isn't working.
I added the Dropbox URL to my repositories list:
<repository>
<id>ProWritingAid</id>
<name>Remote ProWritingAid Repository</name>
<url>https://www.dropbox.com/sh/fbv...</url>
</repository>
and I've defined the dependencies like:
<!-- Keshavram Kuduwa's Dropbox Repository -->
<dependency>
<groupId>com.prowritingaid.java</groupId>
<artifactId>pro_writing_aid_java</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Keshavram Kuduwa's Dropbox Repository -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>2.7.5</version>
</dependency>
The compile-time error is:
> Description Resource Path Location Type
Archive for required library: '/home/de-10/.m2/repository/com/prowritingaid/java/pro_writing_aid_java/2.0.0/pro_writing_aid_java-2.0.0.jar' in project 'papertrue' cannot be read or is not a valid ZIP file papertrue Build path Build Path Problem
But on the other hand, when I install these packages locally with the following, it works:
> mvn install:install-file -DgroupId=com.prowritingaid.java -DartifactId=pro_writing_aid_java -Dversion=2.0.0 -Dpackaging=jar -Dfile=pro_writing_aid_java-2.0.0.jar
Moreover, if I delete these locally installed packages and force update the project, the error shows up again. I also replaced the JAR in the remote repository but it didn't help.
答案1
得分: 0
我正在部署的JAR没有pom.xml文件,因此出现了错误。我尝试了一些不同的方法,使用了一个项目内仓库 -> 创建一个项目内Maven仓库并将第三方JAR部署到其中。
英文:
The Jar I was deploying didn't have a pom.xml file and hence the error. I tried something different, to use an in-project repository -> Creating an In-Project Maven Repository and deploying 3rd party JARs to it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论