WSO2样本Maven pom.xml

时间:2013-02-07 21:54:45

标签: maven build wso2 wso2carbon

我想将我的wso2项目打包到Maven中,第一步是将WSO2样本放到maven构建中,然后构建它...但是,无法创建将编译示例代码的pom.xml到目前为止。

在线跟踪了一些小道:WSO2 BAM 2.0 libraries in Maven

其中包括将pom下载并安装到本地存储库,因为它在wso2存储库中不存在,仍然出现错误...

感谢您提供任何帮助或最好的,如果有人拥有WSO2样本的pom.xml并且可以共享它...

这是当前的pom:

<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">

<parent>
    <groupId>org.wso2.carbon</groupId>
    <artifactId>carbon-components</artifactId>
    <version>3.2.0</version>
</parent>


<repositories>
    <repository>
        <id>wso2-maven2-repository</id>
        <name>WSO2 Maven2 Repository</name>
        <url>http://dist.wso2.org/maven2</url>
        <snapshots>
        <enabled>true</enabled>
        </snapshots>
        <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
        </releases>
    </repository>
</repositories>



<modelVersion>4.0.0</modelVersion>
<groupId>acme</groupId>
<artifactId>acme.wso2</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>

    <dependency>
        <groupId>org.wso2.carbon</groupId>
        <artifactId>org.wso2.carbon.bam.agent</artifactId>
        <version>3.2.4</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.5.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ws.commons.axiom</groupId>
        <artifactId>axiom-api</artifactId>
        <version>1.2.11</version>
    </dependency>


</dependencies>

</project>

以下是我在构建时收到的错误:

c:\projects\acme.wso2> mvn compile

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for acme:acme.wso2:jar:1.0-SNAPSHOT
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.wso2.carbon:org.wso2.carbon.core.common:jar -> duplicate declaration of version ${carbon.platform.version} @ org.wso2.carbon:c
arbon-components:3.2.0, C:\Users\Tony\.m2\repository\org\wso2\carbon\carbon-components\3.2.0\carbon-components-3.2.0.pom, line 1025, column 25
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.wso2.carbon:org.wso2.carbon.mashup.jsservices.stub:jar -> duplicate declaration of version ${carbon.platform.version} @ org.ws
o2.carbon:carbon-components:3.2.0, C:\Users\Tony\.m2\repository\org\wso2\carbon\carbon-components\3.2.0\carbon-components-3.2.0.pom, line 2128, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building acme.wso2 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for net.sf.saxon:saxon:jar:8.9 is missing, no dependency information available
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/eclipse/osgi/org.eclipse.osgi.services/3.2.0.v20
090520-1800/org.eclipse.osgi.services-3.2.0.v20090520-1800.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 8edc83998e0bf2a8867395883f3853eb901be267 for http://maven.wso2.org/nexus/content/groups/wso2-public/org/eclipse/osgi/org.eclipse.osgi.services/3.2.0.v20090520-1800/org.eclipse.osgi.services-3.2.0.v20090520-1800.pom
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/bsf/bsf-all/3.0/bsf-all-3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.956s
[INFO] Finished at: Thu Feb 07 16:43:12 EST 2013
[INFO] Final Memory: 12M/161M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project acme.wso2: Could not resolve dependencies for project acme:acme.wso2:jar:1.0-SNAPSHOT:
    Failed to collect dependencies for [org.wso2.carbon:org.wso2.carbon.bam.agent:jar:3.2.4 (compile),
    javax:javaee-api:jar:6.0 (provided),
    org.apache.axis2:axis2:jar:1.5.1 (compile),
    org.apache.ws.commons.axiom:axiom-api:jar:1.2.11 (compile)]:
    Failed to read artifact descriptor for org.eclipse.osgi:org.eclipse.osgi.services:jar:3.2.0.v20090520-1800:
    Could not transfer artifact org.eclipse.osgi:org.eclipse.osgi.services:pom:3.2.0.v20090520-1800 from/to wso2-nexus
    (http://maven.wso2.org/nexus/content/groups/wso2-public/):
    Checksum validation failed, expected <!DOCTYPE but is 8edc83998e0bf2a8867395883f3853eb901be267 -> [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

2 个答案:

答案 0 :(得分:1)

你能像这样构建这个pom文件吗,

mvn clean install -c

这将忽略checkssum错误。

答案 1 :(得分:0)

repositories标记替换为以下内容。您的依赖项将在其中一个存储库中提供。如果校验和错误似乎仍然存在,请参阅@ Harsha的答案。

<repositories>
    <repository>
        <id>wso2-nexus</id>
        <name>WSO2 internal Repository</name>
        <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>ignore</checksumPolicy>
        </releases>
    </repository>
    <repository>
        <id>wso2.releases</id>
        <name>WSO2 internal Repository</name>
        <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>ignore</checksumPolicy>
        </releases>
    </repository>
    <repository>
        <id>wso2.snapshots</id>
        <name>WSO2 Snapshot Repository</name>
        <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
    </repository>
</repositories>