我正在开发一个bukkit插件,并将maven作为我的依赖项管理器。我正在尝试使用sk89q的命令框架。但是,maven找不到依赖项。这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.muukrls.minelol</groupId>
  <artifactId>MineLoL</artifactId>
  <version>0.0.1</version>
  <packaging>jar</packaging>

  <name>MineLoL</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <repositories>
    <repository>
      <id>repo.oc.tc</id>
      <url>https://repo.oc.tc/content/repositories/releases/</url>
    </repository>
    <repository>
      <id>bukkit-repo</id>
      <url>http://repo.bukkit.org/content/groups/public/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.bukkit</groupId>
      <artifactId>bukkit</artifactId>
      <version>1.7.9-R0.1</version>
      <scope>provided</scope>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>com.sk89q</groupId>
      <artifactId>command-framework-core</artifactId>
      <version>0.4</version>
    </dependency>
  </dependencies>
</project>


这是stacktrace:我认为问题是它正在bukkit存储库中寻找命令框架。但是我该怎么解决

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethrea
ded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MineLoL 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.283 s
[INFO] Finished at: 2014-05-28T17:34:22+01:00
[INFO] Final Memory: 5M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MineLoL: Could not resolve dependencie
s for project com.muukrls.minelol:MineLoL:jar:0.0.1: Failed to collect dependenc
ies at com.sk89q:command-framework-core:jar:0.4: Failed to read artifact descrip
tor for com.sk89q:command-framework-core:jar:0.4: Failure to find com.sk89q:comm
and-framework-parent:pom:static in http://repo.bukkit.org/content/groups/public/
 was cached in the local repository, resolution will not be reattempted until th
e update interval of bukkit-repo has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project MineLoL: Could not resolve dependencies for project com.muukrls.minelo
l:MineLoL:jar:0.0.1: Failed to collect dependencies at com.sk89q:command-framewo
rk-core:jar:0.4
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:220)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:127)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:257)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:200)
        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.buildProje
ct(LifecycleModuleBuilder.java:108)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:76)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:116)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project com.muukrls.minelol:MineLoL:jar:0.0.1: Failed to c
ollect dependencies at com.sk89q:command-framework-core:jar:0.4
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:167)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:195)
        ... 22 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed t
o collect dependencies at com.sk89q:command-framework-core:jar:0.4
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDe
pendencies(DefaultDependencyCollector.java:292)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDepen
dencies(DefaultRepositorySystem.java:317)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:159)
    ... 23 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to
read artifact descriptor for com.sk89q:command-framework-core:jar:0.4
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:370)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(D
efaultDependencyCollector.java:461)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDe
pendencies(DefaultDependencyCollector.java:261)
        ... 25 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure
 to find com.sk89q:command-framework-parent:pom:static in http://repo.bukkit.org
/content/groups/public/ was cached in the local repository, resolution will not
be reattempted until the update interval of bukkit-repo has elapsed or updates a
re forced
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveMode
l(DefaultModelResolver.java:126)
        at org.apache.maven.model.building.DefaultModelBuilder.readParentExterna
lly(DefaultModelBuilder.java:817)
        at org.apache.maven.model.building.DefaultModelBuilder.readParent(Defaul
tModelBuilder.java:669)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode
lBuilder.java:307)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:361)
        ... 28 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to
 find com.sk89q:command-framework-parent:pom:static in http://repo.bukkit.org/co
ntent/groups/public/ was cached in the local repository, resolution will not be
reattempted until the update interval of bukkit-repo has elapsed or updates are
forced
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.java:459)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
acts(DefaultArtifactResolver.java:262)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
act(DefaultArtifactResolver.java:239)
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveMode
l(DefaultModelResolver.java:122)
        ... 32 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to fin
d com.sk89q:command-framework-parent:pom:static in http://repo.bukkit.org/conten
t/groups/public/ was cached in the local repository, resolution will not be reat
tempted until the update interval of bukkit-repo has elapsed or updates are forc
ed
        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newExcepti
on(DefaultUpdateCheckManager.java:232)
        at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtif
act(DefaultUpdateCheckManager.java:206)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownlo
ads(DefaultArtifactResolver.java:599)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownl
oads(DefaultArtifactResolver.java:518)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
ultArtifactResolver.java:436)
        ... 35 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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException

最佳答案

问题是您在错误的存储库下查找。您应该在/ releases目录中查找,而应该在/ public目录中查找。

<repository>
  <id>repo.oc.tc</id>
  <url>https://repo.oc.tc/content/repositories/public/</url>
</repository>

关于java - Bukkit Maven sk89q的命令框架,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23916403/

10-16 06:21