在此一个依赖项上获取此错误。昨天当我停下来的时候它起作用,然后当我再次开始时它没有工作。我没有关闭任何应用程序,更不用说计算机了。其他依赖项工作正常,我可以看到所谓的丢失文件位于本地存储库中的正确目录中。
以下是存储库中文件的视图
$ cd /c/users/thomsen.dean/.m2/repository/oes-common/oes-common/
thomsen.dean@US-PRECXIVJZ MINGW64 /c/users/thomsen.dean/.m2/repository/oes-common/oes-common
$ ls -l
total 9
-rw-r--r-- 1 thomsen.dean 1049089 304 Oct 8 2014 maven-metadata.xml
drwxr-xr-x 1 thomsen.dean 1049089 0 Sep 8 10:44 RELEASE/
-rw-r--r-- 1 thomsen.dean 1049089 555 Sep 8 10:44 resolver-status.properties
您可以看到mave-metadata.xml文件存在,这是文件的内容。
$ cat maven-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>oes-common</groupId>
<artifactId>oes-common</artifactId>
<versioning>
<release>RELEASE</release>
<versions>
<version>RELEASE</version>
</versions>
<lastUpdated>20141008090909</lastUpdated>
</versioning>
</metadata>
这是maven命令和错误
错误是:“找不到元数据oes-common:本地的oes-common / maven-metadata.xml(C:\ Users \ thomsen.dean.m2 \ repository)”。但是你可以从上面看到该文件存在并且似乎没有被破坏。
$ mvn clean install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CCDRCDWeb 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.403 s
[INFO] Finished at: 2017-09-08T13:21:05-06:00
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CCDRCDWeb: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE: Failed to read artifact descriptor for oes-common:oes-common:jar:RELEASE: Failed to resolve version for oes-common:oes-common:jar:RELEASE: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project CCDRCDWeb: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:180)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for oes-common:oes-common:jar:RELEASE
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:245)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
... 26 more
Caused by: org.eclipse.aether.resolution.VersionResolutionException: Failed to resolve version for oes-common:oes-common:jar:RELEASE: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:300)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:231)
... 33 more
Caused by: org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:247)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:205)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:237)
... 34 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这里有两个来自pom.xml的依赖项。
这个工作
<dependency>
<groupId>oes-dataobjects</groupId>
<artifactId>oes-dataobjects</artifactId>
<version>RELEASE</version>
<scope>provided</scope>
</dependency>
这个不起作用
<dependency>
<groupId>oes-common</groupId>
<artifactId>oes-common</artifactId>
<version>RELEASE</version>
<scope>provided</scope>
</dependency>
我试图删除本地存储库中的目录并重新创建它。
我已编辑该文件以确保其可访问。
我无法弄清楚maven在抱怨什么。
希望有人在此之前已经看过这个并且可以解释出现了什么问题。