2017-05-15 36 views
2

我试着按照这个post设置与java的wso2(因为我没有足够的声誉,我不能评论邮件本身)。所有的步骤都已经实现,并且wso2正在本地主机上运行。带弹簧的wso2配置。 Maven的依赖问题

我首先遇到的问题是,我不能运行

mvn clean install 

随着我需要配置WSO2的依赖关系。我试过几个dependencies从内行库的,但我得到安装

[ERROR] Failed to execute goal on project ku: Could not resolve dependencies for project jjsdmco:ku:jar:1.0-DEVELOP: Could not find artifact org.wso2.carbon:org.wso2.carbon.user.mgt:jar:4.2.2 in central (https://repo.maven.apache.org/maven2) -> [Help 1] 

从类似问题提供的解决方案并没有帮助从清洁输出相同。例如:

mvn clean install -U 

运行从答案我获得更新的POM文件从清洁以下输出安装

[ERROR] Failed to execute goal on project ku: Could not resolve dependencies for project jjsdmco:ku:jar:1.0-DEVELOP: Failure to find org.wso2.carbon:org.wso2.carbon.user.mgt:jar:4.2.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[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 read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

运行:

mvn clean install -U 

给出:

[ERROR] Failed to execute goal on project ku: Could not resolve dependencies for project jjsdmco:ku:jar:1.0-DEVELOP: Could not find artifact org.wso2.carbon:org.wso2.carbon.user.mgt:jar:4.2.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[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 read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

这是我的pom文件:

<?xml version="1.0" encoding="UTF-8"?> 
<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>jjsdmco</groupId> 
    <artifactId>ku</artifactId> 

    <version>1.0-DEVELOP</version> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.5.1.RELEASE</version> 
    </parent> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>wso2-maven2-repository-1</id> 
      <url>http://dist.wso2.org/maven2</url> 
     </pluginRepository> 
     <pluginRepository> 
      <id>wso2-maven2-repository-2</id> 
      <url>http://dist.wso2.org/snapshots/maven2</url> 
     </pluginRepository> 
     <pluginRepository> 
      <id>wso2-maven2-repository-3</id> 
      <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url> 
     </pluginRepository> 
    </pluginRepositories> 

    <dependencies> 
     <!-- Security implementations 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-web</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-security</artifactId> 
     </dependency> 
     END security implementation --> 
     <!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2 --> 
     <dependency> 
      <groupId>org.springframework.security.oauth</groupId> 
      <artifactId>spring-security-oauth2</artifactId> 
      <version>2.1.0.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.ws</groupId> 
      <artifactId>spring-ws-core</artifactId> 
      <version>2.4.0.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>4.3.0.RELEASE</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
      <version>9.4-1206-jdbc42</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-autoconfigure</artifactId> 
      <version>1.5.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web-services</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>wsdl4j</groupId> 
      <artifactId>wsdl4j</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-failsafe-plugin</artifactId> 
      <version>2.19.1</version> 
      <type>maven-plugin</type> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin --> 
     <dependency> 
      <groupId>org.jacoco</groupId> 
      <artifactId>jacoco-maven-plugin</artifactId> 
      <version>0.7.9</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.apache.maven.surefire/surefire-api --> 
     <dependency> 
      <groupId>org.apache.maven.surefire</groupId> 
      <artifactId>surefire-api</artifactId> 
      <version>2.18.1</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.apache.maven.surefire/surefire-junit4 --> 
     <dependency> 
      <groupId>org.apache.maven.surefire</groupId> 
      <artifactId>surefire-junit4</artifactId> 
      <version>2.18.1</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
      <version>4.5.3</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.xml.bind</groupId> 
      <artifactId>jaxb-api</artifactId> 
      <version>2.2.7</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-config</artifactId> 
      <version>3.2.6.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-config</artifactId> 
      <version>3.2.6.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.xml.bind</groupId> 
      <artifactId>jaxb-core</artifactId> 
      <version>2.2.7</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.data</groupId> 
      <artifactId>spring-data-commons</artifactId> 
      <version>1.6.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-autoconfigure</artifactId> 
      <version>1.5.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-autoconfigure</artifactId> 
      <version>1.5.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-autoconfigure</artifactId> 
      <version>1.5.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-autoconfigure</artifactId> 
      <version>1.5.1.RELEASE</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/org.apache.ant/ant --> 
     <dependency> 
      <groupId>org.apache.ant</groupId> 
      <artifactId>ant</artifactId> 
      <version>1.10.1</version> 
     </dependency> 

     <!-- https://mvnrepository.com/artifact/org.wso2.carbon/org.wso2.carbon.user.mgt --> 
     <dependency> 
      <groupId>org.wso2.carbon</groupId> 
      <artifactId>org.wso2.carbon.user.mgt</artifactId> 
      <version>4.2.1</version> 
     </dependency> 


    </dependencies> 




    <properties> 
     <java.version>1.8</java.version> 

    </properties> 

    <build> 
     <plugins> 
      <!-- Spring SOAP WS tutorial --> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-failsafe-plugin</artifactId> 
       <version>2.18.1</version> 
       <executions> 
        <execution> 
         <id>integration-test</id> 
         <goals> 
          <goal>integration-test</goal> 
         </goals> 
        </execution> 
        <execution> 
         <id>verify</id> 
         <goals> 
          <goal>verify</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 


      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
       <configuration> 
        <classifier>exec</classifier> 
       </configuration> 
      </plugin> 



      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 

       <configuration> 
        <archive> 
         <manifest> 
          <addClasspath>true</addClasspath> 
          <mainClass>executor.Application</mainClass> 
         </manifest> 
        </archive> 
       </configuration> 

      </plugin> 
     </plugins> 
    </build> 
</project> 

回答

0

您可以尝试将以下储存库添加到您的pom文件吗?

<pluginRepositories> 
     <pluginRepository> 
      <id>wso2-maven2-repository-1</id> 
      <url>http://dist.wso2.org/maven2</url> 
     </pluginRepository> 
     <pluginRepository> 
      <id>wso2-maven2-repository-2</id> 
      <url>http://dist.wso2.org/snapshots/maven2</url> 
     </pluginRepository> 
     <pluginRepository> 
      <id>wso2-maven2-repository-3</id> 
      <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url> 
     </pluginRepository> 
    </pluginRepositories> 
+0

我更新了我用干净的答案加装输出,之后加入你的答案,我的POM文件 – Steingrrim

+0

请“MVN全新安装-U”命令试试。如果没有解决,请附上你的POM文件。 –

+0

我将我的pom文件添加到了帖子中 – Steingrrim