最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

maven fails to find resources in local repository (running on Windows) - Stack Overflow

programmeradmin2浏览0评论

Project Context

I got to manage a Java application that was until now mantained by a "lone ranger", a very skilled single person thet handled the project brillantly until recent times and worked all by himself, building the artifacts within his own IDE (Eclipse) installation without resorting to any building tool.

Since in the future the application could benefit also of such things as "continuous integration", I added a maven set of files.

The original application relied on a libs directory containint the jar file for compile time and runtime dependencies, therefore I provided a script that performs the following command for each original jar file:

mvn install:install-file -Dfile=path-to-jarfile.jar -DgroupId="it.eng.locallib" -DartifactId="commons-compress-1.25.0" -Dversion="1.0.0" -Dpackaging=jar -DgeneratePom=true;

The problem

On one machine (Windows 11), the compilation fails with this message:

Caused by: The following artifacts could not be resolved: .eclipse.nebula:progresscircle:pom:1.0.0-SNAPSHOT (absent): Could not find artifact .eclipse.nebula:progresscircle:pom:1.0.0-SNAPSHOT in local-maven-repository (file://C:\Users\username/.m2/repository) [ERROR] Failed to read artifact descriptor for it.eng.locallib:.eclipse.rap.addons.ckeditor_0.2.0.20150605-1208:jar:1.0.0

Even if the previous mvn isntall:install-file reports no problem, the .m2 directories on the faulty machine and on one where everything goes OK (not only my own :) ) looks identical.

The dependency file has this dependency definition:

<dependency> <groupId>it.eng.locallib</groupId> <artifactId>.eclipse.nebula.widgets.progresscircle_1.0.0.201804281520</artifactId> <version>1.0.0</version> <!-- not 1.0.0-SNAPSHOT --> </dependency> While the project is actually in 1.0-SNAPSHOT

Any suggestion on what could cause the problem?

Project Context

I got to manage a Java application that was until now mantained by a "lone ranger", a very skilled single person thet handled the project brillantly until recent times and worked all by himself, building the artifacts within his own IDE (Eclipse) installation without resorting to any building tool.

Since in the future the application could benefit also of such things as "continuous integration", I added a maven set of files.

The original application relied on a libs directory containint the jar file for compile time and runtime dependencies, therefore I provided a script that performs the following command for each original jar file:

mvn install:install-file -Dfile=path-to-jarfile.jar -DgroupId="it.eng.locallib" -DartifactId="commons-compress-1.25.0" -Dversion="1.0.0" -Dpackaging=jar -DgeneratePom=true;

The problem

On one machine (Windows 11), the compilation fails with this message:

Caused by: The following artifacts could not be resolved: .eclipse.nebula:progresscircle:pom:1.0.0-SNAPSHOT (absent): Could not find artifact .eclipse.nebula:progresscircle:pom:1.0.0-SNAPSHOT in local-maven-repository (file://C:\Users\username/.m2/repository) [ERROR] Failed to read artifact descriptor for it.eng.locallib:.eclipse.rap.addons.ckeditor_0.2.0.20150605-1208:jar:1.0.0

Even if the previous mvn isntall:install-file reports no problem, the .m2 directories on the faulty machine and on one where everything goes OK (not only my own :) ) looks identical.

The dependency file has this dependency definition:

<dependency> <groupId>it.eng.locallib</groupId> <artifactId>.eclipse.nebula.widgets.progresscircle_1.0.0.201804281520</artifactId> <version>1.0.0</version> <!-- not 1.0.0-SNAPSHOT --> </dependency> While the project is actually in 1.0-SNAPSHOT

Any suggestion on what could cause the problem?

Share Improve this question asked Mar 15 at 13:14 saintsaint 644 bronze badges 2
  • a very skilled single person thet handled the project brillantly until recent times and worked all by himself, building the artifacts within his own IDE that's not a brilliant person exactly the opposite. A script which installs deps from a lib directory is the wrong way. Find out which artifacts are those (given example .. commons-compress existing in central repository (checking the SHA1/version from the manifest of the jar file if it has NOT been manually repackaged or alike) – khmarbaise Commented Mar 16 at 11:07
  • central.sonatype/artifact/.apachemons/… and add it as a usual dependency to your pom file... step by step... and get rid of the lib directory... – khmarbaise Commented Mar 16 at 11:08
Add a comment  | 

1 Answer 1

Reset to default 0

This can be closed.

A co-worker fixed the issue, so certain comments have a value going towards 0 from below.

I already decided that I will use our company maven mirror and move there the jars - not all have a maven dependency.

发布评论

评论列表(0)

  1. 暂无评论