我是Gradle的新手,正在尝试将其配置为构建rosjava。我相信我有一个相对简单的多项目配置。一切都通过gradle install构建,测试并安装到我的本地Maven存储库中。但是,当我尝试使用Eclipse插件生成.project和.classpath文件时,它失败了:
Execution failed for task ':rosjava:eclipseClasspath'.
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
> Module version group:ros.rosjava_core, module:rosjava, version:0.0.0-SNAPSHOT, configuration:detachedConfiguration1 declares a dependency on configuration 'archives' which is not declared in the module descriptor for group:ros.rosjava_core, module:rosjava_bootstrap, version:0.0.0-SNAPSHOT
我不确定如何调试它。该项目的基本布局是:
rosjava_core/build.gradle
rosjava_core/rosjava/build.gradle
rosjava_core/rosjava_bootstrap/build.gradle
rosjava项目依赖于rosjava_bootstrap,如下所示:
dependencies {
compile project(':rosjava_bootstrap')
}
rosjava_bootstrap项目没有依赖项。
这是血腥的细节:
~/ros/workspace/rosjava_core$ gradle rosjava:eclipse -i --stacktrace
Starting Build
Settings evaluated using settings file '/home/damonkohler/ros/workspace/rosjava_core/settings.gradle'.
Projects loaded. Root project using build file '/home/damonkohler/ros/workspace/rosjava_core/build.gradle'.
Included projects: [root project 'rosjava_core', project ':apache_xmlrpc_client', project ':apache_xmlrpc_common', project ':apache_xmlrpc_server', project ':rosjava', project ':rosjava_actionlib', project ':rosjava_actionlib_tutorial', project ':rosjava_bootstrap', project ':rosjava_geometry', project ':rosjava_tut
orial_pubsub']
Evaluating root project 'rosjava_core' using build file '/home/damonkohler/ros/workspace/rosjava_core/build.gradle'.
Evaluating project ':apache_xmlrpc_client' using build file '/home/damonkohler/ros/workspace/rosjava_core/apache_xmlrpc_client/build.gradle'.
Evaluating project ':apache_xmlrpc_common' using build file '/home/damonkohler/ros/workspace/rosjava_core/apache_xmlrpc_common/build.gradle'.
Evaluating project ':apache_xmlrpc_server' using build file '/home/damonkohler/ros/workspace/rosjava_core/apache_xmlrpc_server/build.gradle'.
Evaluating project ':rosjava' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava/build.gradle'.
Evaluating project ':rosjava_actionlib' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava_actionlib/build.gradle'.
Evaluating project ':rosjava_actionlib_tutorial' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava_actionlib_tutorial/build.gradle'.
Evaluating project ':rosjava_bootstrap' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava_bootstrap/build.gradle'.
Evaluating project ':rosjava_geometry' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava_geometry/build.gradle'.
Evaluating project ':rosjava_tutorial_pubsub' using build file '/home/damonkohler/ros/workspace/rosjava_core/rosjava_tutorial_pubsub/build.gradle'.
All projects evaluated.
Selected primary task 'rosjava:eclipse'
Tasks to be executed: [task ':rosjava:eclipseClasspath', task ':rosjava:eclipseJdt', task ':rosjava:eclipseProject', task ':rosjava:eclipse']
:rosjava:eclipseClasspath
:: loading settings :: url = jar:file:/home/damonkohler/gradle-1.0-milestone-8a/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rosjava:eclipseClasspath'.
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
> Module version group:ros.rosjava_core, module:rosjava, version:0.0.0-SNAPSHOT, configuration:detachedConfiguration1 declares a dependency on configuration 'archives' which is not declared in the module descriptor for group:ros.rosjava_core, module:rosjava_bootstrap, version:0.0.0-SNAPSHOT
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':rosjava:eclipseClasspath'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:250)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:238)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:222)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
C aused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration 'detachedConfiguration1'.
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:47)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.access$000(ErrorHandlingArtifactDependencyResolver.java:26)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$BrokenResolvedConfiguration.getLenientConfiguration(ErrorHandlingArtifactDependencyResolver.java:123)
at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.getFiles(IdeDependenciesExtractor.groovy:219)
at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.this$2$getFiles(IdeDependenciesExtractor.groovy)
at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$this$2$getFiles.callCurrent(Unknown Source)
at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.extractRepoFileDependencies(IdeDependenciesExtractor.groovy:99)
at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$extractRepoFileDependencies.call(Unknown Source)
at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$4.update(ClasspathFactory.groovy:56)
at org.gradle.plugins.ide.eclipse.model.internal.ClasspathEntryBuilder$update.call(Unknown Source)
at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory.createEntries(ClasspathFactory.groovy:82)
at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$createEntries.call(Unknown Source)
at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.resolveDependencies(EclipseClasspath.groovy:213)
at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.mergeXmlClasspath(EclipseClasspath.groovy:220)
at org.gradle.plugins.ide.eclipse.model.EclipseClasspath$mergeXmlClasspath.call(Unknown Source)
at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy:45)
at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy)
at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:41)
at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:35)
at org.gradle.plugins.ide.api.GeneratorTask.generate(GeneratorTask.java:77)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:495)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:484)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
... 54 more
Caused by: java.lang.RuntimeException: Module version group:ros.rosjava_core, module:rosjava, version:0.0.0-SNAPSHOT, configuration:detachedConfiguration1 declares a dependency on configuration 'archives' which is not declared in the module descriptor for group:ros.rosjava_core, module:rosjava_bootstrap, version:0.0.0-SNAPSHOT
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:322)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:283)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:117)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:53)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:67)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:36)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:34)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:99)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:49)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:34)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:42)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:78)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:36)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:237)
... 81 more
BUILD FAILED
Total time: 5.347 secs
和gradle的版本:
~/ros/workspace/rosjava_core$ gradle -v
------------------------------------------------------------
Gradle 1.0-milestone-8a
------------------------------------------------------------
Gradle build time: Monday, February 20, 2012 4:00:18 PM UTC
Groovy: 1.8.4
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_20 (Sun Microsystems Inc. 19.0-b09)
OS: Linux 2.6.32-37-generic amd64
完整的源代码和构建脚本可在此处获得:http://code.google.com/r/damonkohler-rosjava-unstable/source/browse
最佳答案
按照here所述修复我的依赖关系后,此问题消失了。