带弹簧的wso2配置。 Maven依赖问题

时间:2017-05-15 10:27:22

标签: spring maven wso2 dependencies

我已经尝试使用java post设置wso2(因为我没有足够的声誉,我无法对帖子本身发表评论)。所有步骤都已实现,wso2正在localhost中运行。

我第一次遇到的问题是我无法运行

mvn clean install 

使用依赖项我需要配置wso2。我已经尝试了几个来自mavens存储库的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文件我从clean install

获得以下输出
[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>

1 个答案:

答案 0 :(得分: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>