【发布时间】:2015-09-15 11:02:43
【问题描述】:
我对 Maven 不太满意,但我设法让它在 Netbeans 上工作了一段时间。但突然间,Maven 拒绝下载新的依赖项:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project matheos: Could not resolve dependencies for project lecoleopensource:matheos:jar:1.4.4-SNAPSHOT: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project lecoleopensource:matheos:jar:1.4.4-SNAPSHOT: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:348)
... 26 more
某些东西显然处于离线状态,但我不明白为什么以及如何解决这个问题。
这是我的 pom 文件的一部分:
<dependencies>
<!-- docx4j : converts html to docx -->
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j</artifactId>
<version>3.2.2</version>
</dependency>
<!-- pdf2dom : converts pdf to html -->
<!--dependency>
<groupId>net.sf.cssbox</groupId>
<artifactId>pdf2dom</artifactId>
<version>1.3</version>
</dependency-->
</dependencies>
我不明白的是它以前可以正常工作到现在......
我不太了解 Maven,所以请告诉我是否应该提供其他详细信息。谢谢!
编辑:我删除了存储库部分,仍然一样。我把artefactID编辑成docx4j,还是一样。
【问题讨论】:
-
查看这条消息
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project lecoleopensource:matheos:jar:1.4.4-SNAPSHOT: The repository system is offline but the artifact org.docx4j:docx4j-ImportXHTML:jar:3.2.2 is not available in the local repository.。 Maven 尝试下载 org.docx4j 的依赖项,但无法做到,并尝试在本地 repo 中找到 org.docx4j。而无法做到这一点。 -
@Rafael Osipov :我或多或少理解这个问题。我不明白的是为什么 maven 像你说的那样“无法做到”......