2016-07-28 54 views
0

我有以下gradle.build文件。我想從wsdl產生jarModuleVersionNotFoundException:無法解析外部依賴關係org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb

group 'com.parma.rudenkov' 
version '1.0-SNAPSHOT' 

buildscript { 
    repositories { 
     maven { 
      url "https://plugins.gradle.org/m2/" 
     } 
    } 
    dependencies { 
     classpath "no.nils:wsdl2java:0.10" 
    } 
} 

apply plugin: "no.nils.wsdl2java" 
apply plugin: "java" 


wsdl2java{ 
    wsdlsToGenerate = [ 
      ['-p','com.acme.mypackage', '-autoNameResolution',"$projectDir/src/main/resources/myWsdlFiles/BuyerServiceBean.wsdl"] 
    ] 
    generatedWsdlDir = file("$projectDir/generatedsources") 
    wsdlDir = file("$projectDir/src/main/resources/wsdl") 
    locale = Locale.FRANCE 
} 

當我運行gradle wsdl2java --stacktrace我得到以下異常:

Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':wsdl2java'. 
     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.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:163) 
     at org.gradle.api.internal.BeanDynamicObject.getProperty(BeanDynamicObject.java:106) 
     at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:81) 
     at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source) 
     at no.nils.wsdl2java.Wsdl2JavaTask.setupClassLoader(Wsdl2JavaTask.groovy:94) 
     at no.nils.wsdl2java.Wsdl2JavaTask.wsdl2java(Wsdl2JavaTask.groovy:64) 
     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219) 
     at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208) 
     at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585) 
     at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) 
     ... 58 more 
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Cannot resolve external dependency org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb:+ because no repositories are defined. 
Required by: 
    com.param.rudenkov:pan:1.0-SNAPSHOT 
     at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.NoRepositoriesResolver.resolve(NoRepositoriesResolver.java:48) 
     at org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver.resolve(ProjectDependencyResolver.java:58) 
     at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionResolver.resolve(DependencySubstitutionResolver.java:50) 
     at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionSelectorResolveState.resolveModuleRevisionId(DependencyGraphBuilder.java:861) 
     at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.resolveModuleRevisionId(DependencyGraphBuilder.java:230) 
     at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:119) 
     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) 
     ... 74 more 


BUILD FAILED 

回答

0

你從哪裏下載jar庫指定庫。

repositories{ 
    mavenCentral() 
}