jpacontainer-addressbook-demo的问题

大家好!

           我在用mvn  package   构建jpacontainer-addressbook-demo时候,结果失败了, 下面是所报的错误  :

[FATAL]
Non-resolvable parent POM: Failure to find com.vaadin.addon:jpacontainer
-modules:pom:3.0.0.beta1 in http://repository.jboss.org/nexus/content/groups/pub
lic was cached in the local repository, resolution will not be reattempted until
the update interval of jboss-public-repository-group has elapsed or updates are
forced and ‘parent.relativePath’ points at wrong local POM @ line 4, column 13

    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu

ilder.java:363)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven
.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
[ERROR]

不知如何解决? 谢谢各位!!
还有 就是如何将eclipselink 改为hibernate4 ,在persistence.xml 和 pom.xml 中。

jpacontainer-addressbook-demo的
pom
,在前几行你可以看到它需要一个parent, 可能是因为这个抛的异常。你可以试下checkout 整个
JPAContainer
, mvn package一下整个project,看有没帮助。
关于把eclipselink 改为hibernate4,把persistence.xml 和 pom.xml中所有eclipselink的东西都改成hibernate4的应该就行了吧,不过应该不只是改这两个配置文件吧。Java代码应该也需要改动的

我也遇到這個問題,還是解決不了 :frowning:

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


4.0.0
com.vaadin.demo
jpacontainer-addressbook-demo
war
1.0
Simple Vaadin JPAContainer example app

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.0.0</vaadin.version>



Apache License version 2.0
http://www.apache.org/licenses/LICENSE-2.0.html
repo




vaadin-addons
http://maven.vaadin.com/vaadin-addons


vaadin-snapshots
http://oss.sonatype.org/content/repositories/vaadin-snapshots/

false


true



EclipseLink
http://download.eclipse.org/rt/eclipselink/maven.repo




vaadin-snapshots
http://oss.sonatype.org/content/repositories/vaadin-snapshots/

false


true


<dependencies>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiled</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.3</version>
        <scope>provided</scope>
    </dependency>
   <dependency>
	<groupId>com.vaadin.addon</groupId>
	<artifactId>jpacontainer</artifactId>
	<version>3.0.0</version>
	</dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.160</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.mycila.maven-license-plugin</groupId>
            <artifactId>maven-license-plugin</artifactId>
            <version>1.9.0</version>
            <configuration>
                <basedir>${basedir}</basedir>
                <header>${basedir}/../java-license-header.txt</header>
                <quiet>false</quiet>
                <failIfMissing>true</failIfMissing>
                <aggregate>false</aggregate>
                <useDefaultExcludes>true</useDefaultExcludes>
                <useDefaultMapping>true</useDefaultMapping>
                <encoding>UTF-8</encoding>
                <properties>
                    <year>2009-2013</year>
                </properties>
                <excludes>
                    <exclude>*/target/**</exclude>
                    <exclude>*/doc/**</exclude>
                    <exclude>**/*.xml</exclude>
                    <exclude>**/README</exclude>
                    <exclude>**/LICENSE</exclude>
                </excludes>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>format</goal>
                    </goals>
                </execution>
                <execution>
                    <id>check-headers</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

改下pom文件去掉代码中的parent的依赖。
mvn package
mvn jetty:run -Djetty.port=8081