开发者

Building OpenCMIS hello world fails with Cannot find parent: org.apache.chemistry.opencmis:chemistry-opencmis

I am trying to build the hello world for OpenCMIS that I found documented here:

http://chemistry.apache.org/java/developing/guide.html

I am very new to maven and somewhat confused by this error. Has any one else run into this? What was your fix. Below it the full output from trying to build. According to my understanding from the docs this is supposed to build and run the hello world.

james@jamesp:~/workspace/chemistry-opencmis-hello$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null

Reason: Cannot find parent: org.apache.chemistry.opencmis:chemistry-opencmis for project: org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null for project org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.apache.chemistry.opencmis:chemistry-opencmis for project: org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null for project org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.apache.chemistry.opencmis:chemistry-opencmis for project: org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null for project org.apache.chemistry.opencmis:chemistry-opencmis-hello:jar:null
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
    at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
    at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
    ... 12 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.chemistry.opencmis:chemistry-opencmis' not found in repository: Unable to download the artifact from any repository

  org.apache.chemistry.opencmis:chemistry-opencmis:pom:0.5.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

 for project org.apache.chemistry.opencmis:chemistry-opencmis
    at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
    ... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

  org.apache.chemistry.opencmis:chemistry-opencmis:pom:0.5.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
    at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
    ... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
    at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
    ... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jul 26 10:05:51 MDT 2011
[INFO] Final Memory: 1M/52M
[INFO] ------------------------------------------------------------------------

p开发者_开发技巧om.xml

<?xml version="1.0" encoding="UTF-8"?>

<!-- Licensed under the Apache License, Version 2.0 (the "License"); you 
 may not use this file except in compliance with the License. You may obtain 
 a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
 required by applicable law or agreed to in writing, software distributed 
 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
 OR CONDITIONS OF ANY KIND, either express or implied. See the License for 
 the specific language governing permissions and limitations under the License. -->

<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/maven-v4_0_0.xsd">

 <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.chemistry.opencmis</groupId>
        <artifactId>chemistry-opencmis</artifactId>
        <version>0.5.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <!-- Project Information -->

    <groupId>org.apache.chemistry.opencmis</groupId>
    <artifactId>chemistry-opencmis-hello</artifactId>
    <name>Apache Chemistry OpenCMIS Hello World Example</name>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>java</goal>
                    </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>org.apache.chemistry.opencmis.doc.Hello</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>chemistry-opencmis-client-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

</project>


As @Gagravarr has pointed out, 0.5-SNAPSHOT version of chemistry-opencmis is not available in maven central and hence the error. You should try using 0.4.0 version

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜