Gail Maven - OSGI捆绑作为依赖 - 解决问题

时间:2012-04-08 18:33:08

标签: grails maven osgi

我正在尝试使用hector-core作为grails maven构建中的依赖项。

<dependency>
  <groupId>me.prettyprint</groupId>
  <artifactId>hector-core</artifactId>
  <version>1.0-3</version>
  <type>bundle</type>
</dependency>

我收到错误

[ERROR] Failed to execute goal org.grails:grails-maven-plugin:2.0.1:maven-compile (default) on project igiveplatform: Failed to create classpath for Grails execution. Encountered problems resolving dependencies of the executable in preparation for its execution. Failure to find me.prettyprint:hector-core:bundle:1.0-3 in http://repo.grails.org/grails/core was cached in the local repository, resolution will not be reattempted until the update interval of grails has elapsed or updates are forced

Failed to execute goal on project igiveplatform: Could not resolve dependencies 
for project com.igivefirst:igiveplatform:war:0.1-SNAPSHOT: Failure to find
me.prettyprint:hector-core:bundle:1.0-3 in http://repo.grails.org/grails/core 
was cached in the local repository, resolution will not be reattempted until the 
update interval of grails has elapsed or updates are forced

构建试图下载.bundle文件,而不是maven存储库中的.jar。 Grails正常构建这个项目。

提前致谢!

根据下面的建议我删除了类型标签......现在又出现了另一个错误

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.grails:grails-maven-plugin:2.0.1:maven-compile (default) on project igiveplatform: Failed to create classpath for Grails execution.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    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:601)
    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.plugin.MojoExecutionException: Failed to create classpath for Grails execution.
    at org.grails.maven.plugin.AbstractGrailsMojo.generateGrailsExecutionClasspath(AbstractGrailsMojo.java:427)
    at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:225)
    at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:206)
    at org.grails.maven.plugin.MvnCompileMojo.execute(MvnCompileMojo.java:41)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Failure to find me.prettyprint:hector-core:bundle:1.0-3 in http://repo.grails.org/grails/core was cached in the local repository, resolution will not be reattempted until the update interval of grails has elapsed or updates are forced

1 个答案:

答案 0 :(得分:4)

依赖类型应该是jar,而不是bundle。

(看一下类似的问题,Why can't maven find an osgi bundle dependency?