我正在尝试在项目中运行gradle任务。任务来自我分叉的gradle插件。这是使用插件的项目的build.gradle:
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
// Multi-OS Engine plugin
classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.3.6-SNAPSHOT'
}
}
// Apply plugins
apply plugin: 'moe'
它主要是抱怨无法找到明显存在于我的文件系统中的依赖项:
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.multi-os-engine:moe-gradle:1.3.6-SNAPSHOT.
Searched in the following locations:
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/maven-metadata.xml
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.pom
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.jar
我没有责怪MOE这个错误,因为我要求他们plugin并试图通过修改来运行它,这可能是我自己的错。我想了解Gradle为什么会出现此错误。
以下是完整输出:
Using already downloaded SDK: C:\Users\Leejjon\.moe\moe-sdk-1.3.6
:common:compileJava UP-TO-DATE
:common:processResources UP-TO-DATE
:common:classes UP-TO-DATE
:common:jar UP-TO-DATE
:ios:compileJava UP-TO-DATE
:ios:processResources UP-TO-DATE
:ios:classes UP-TO-DATE
:ios:moeMainProGuard UP-TO-DATE
:ios:moeMainRetrolambda UP-TO-DATE
:ios:moeGenerateUIObjCInterfaces UP-TO-DATE
:ios:moeMainDex UP-TO-DATE
:ios:moeRemoteServerSetup
MOE Remote Build - REMOTE_HOME=/Users/leejjon
MOE Remote Build - REMOTE_BUILD_DIR=/var/folders/3m/w6hp3w5n74d8nyybwm9sd7840000gn/T/tmp.8trxgqkq
=======================================================
STARTING REMOTE TASK - FILE UPLOAD: prepare - gradlew
=======================================================
Local Root: C:\Users\Leejjon\.moe\moe-sdk-1.3.6\tools
Remote: /var/folders/3m/w6hp3w5n74d8nyybwm9sd7840000gn/T/tmp.8trxgqkq
\-- gradlew.zip (2.20 MB/s)
<<<<<<<<<<<<<<<<< [REMOTE TASK DONE] >>>>>>>>>>>>>>>>>>
===========================================================
STARTING REMOTE TASK - COMMAND EXECUTION: install MOE SDK
===========================================================
Command: cd /var/folders/3m/w6hp3w5n74d8nyybwm9sd7840000gn/T/tmp.8trxgqkq && unzip /var/folders/3m/w6hp3w5n74d8nyybwm9sd7840000gn/T/tmp.8trxgqkq/gradlew.zip && cd gradlew && echo 'distributionBase=GRADLE_USER_HOME' >> gradle/wrapper/gradle-wrapper.properties && echo 'distributionPath=wrapper/dists' >> gradle/wrapper/gradle-wrapper.properties && echo 'zipStoreBase=GRADLE_USER_HOME' >> gradle/wrapper/gradle-wrapper.properties && echo 'zipStorePath=wrapper/dists' >> gradle/wrapper/gradle-wrapper.properties && echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip' >> gradle/wrapper/gradle-wrapper.properties && echo 'buildscript {' >> build.gradle && echo ' repositories {' >> build.gradle && echo ' mavenLocal();jcenter()' >> build.gradle && echo ' }' >> build.gradle && echo ' dependencies {' >> build.gradle && echo ' classpath group: "org.multi-os-engine", name: "moe-gradle", version: "1.3.6-SNAPSHOT"' >> build.gradle && echo ' }' >> build.gradle && echo '}' >> build.gradle && echo '' >> build.gradle && echo 'apply plugin: "moe-sdk"' >> build.gradle && echo 'task printSDKRoot << { print "REMOTE_MOE_SDK_ROOT___1234567890:${moe.sdk.root}" }' >> build.gradle && ./gradlew printSDKRoot -s && cd .. && rm -rf gradlew && rm -f gradlew.zip
=========================================================
REMOTE TASK FAILED - COMMAND EXECUTION: install MOE SDK
=========================================================
Archive: /var/folders/3m/w6hp3w5n74d8nyybwm9sd7840000gn/T/tmp.8trxgqkq/gradlew.zip
creating: gradlew/
creating: gradlew/gradle/
creating: gradlew/gradle/wrapper/
inflating: gradlew/gradle/wrapper/gradle-wrapper.jar
inflating: gradlew/gradlew
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'gradlew'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find org.multi-os-engine:moe-gradle:1.3.6-SNAPSHOT.
Searched in the following locations:
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/maven-metadata.xml
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.pom
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.jar
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.pom
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.jar
Required by:
:gradlew:unspecified
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'gradlew'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:57)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:488)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:86)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:143)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:47)
at org.gradle.initialization.DefaultGradleLauncher.runBuildOperation(DefaultGradleLauncher.java:189)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:35)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:104)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:97)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.runRootBuildOperation(DefaultGradleLauncher.java:184)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:97)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:93)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:27)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:72)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:44)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:50)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:27)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:40)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':classpath'.
at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:63)
at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDependencyResolver.java:115)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:191)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:674)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:284)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:70)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:141)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:129)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
... 44 more
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.multi-os-engine:moe-gradle:1.3.6-SNAPSHOT.
Searched in the following locations:
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/maven-metadata.xml
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.pom
file:/Users/leejjon/.m2/repository/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.jar
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.pom
https://jcenter.bintray.com/org/multi-os-engine/moe-gradle/1.3.6-SNAPSHOT/moe-gradle-1.3.6-SNAPSHOT.jar
Required by:
:gradlew:unspecified
at org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(DefaultBuildableComponentResolveResult.java:38)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:88)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:59)
at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:44)
at org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver.resolve(ProjectDependencyResolver.java:72)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java:575)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.java:585)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:270)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:244)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:156)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolveDependencyGraph(DependencyGraphBuilder.java:94)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:84)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:142)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:96)
at org.gradle.internal.Transformers$4.transform(Transformers.java:137)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:39)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:96)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:42)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:192)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:187)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:64)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:40)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:56)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:46)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:45)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:363)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:338)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:331)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:672)
... 54 more
BUILD FAILED
Total time: 7.18 secs
:ios:moeRemoteServerSetup FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios:moeRemoteServerSetup'.
> Remote command execution failed
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.507 secs