数据库
首页 > 数据库> > java – 用数据库设置应用程序 – tapestry-hibernate失败

java – 用数据库设置应用程序 – tapestry-hibernate失败

作者:互联网

我正在尝试为我的Web应用程序设置一个pom.xml来连接数据库.当我更改< artifactId> tapestry-core< / artifactId>时,会出现问题. to< artifactId> tapestry-hibernate< / artifactId>.

这是我尝试构建时的输出:

The POM for org.apache.tapestry:tapestry-hibernate:jar:5.4-beta-24 is missing, no dependency information available
The POM for unknown.binary:hibernate-jpa-2.1-api-1.0.0.Final:jar:SNAPSHOT is missing, no dependency information available
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.177s
Finished at: Mon Mar 30 20:18:00 CEST 2015
Final Memory: 6M/15M
------------------------------------------------------------------------
Failed to execute goal on project TapestryApp: Could not resolve dependencies for project com.rile:TapestryApp:war:1.0-SNAPSHOT: Failure to find org.apache.tapestry:tapestry-hibernate:jar:5.4-beta-24 in https://repository.apache.org/content/groups/staging/ was cached in the local repository, resolution will not be reattempted until the update interval of apache-staging has elapsed or updates are forced -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我正在使用最新版本的NetBeans IDE.

这是完整的pom.xml文件:

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.rile</groupId>
    <artifactId>TapestryApp</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>TapestryApp</name>
    <dependencies>
        <!-- To set up an application with a database, change the artifactId below to
        tapestry-hibernate, and add a dependency on your JDBC driver. You'll also
        need to add Hibernate configuration files, such as hibernate.cfg.xml. -->
        <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-hibernate</artifactId>
            <version>${tapestry-release-version}</version>
        </dependency>

        <!-- Include the Log4j implementation for the SLF4J logging framework -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j-release-version}</version>
        </dependency>
        <!--
        <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-hibernate</artifactId>
            <version>${tapestry-release-version}</version>
        </dependency>
        -->
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.3.2</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.34</version>
        </dependency>

        <!-- Uncomment this to add support resource minification and runtime compilation -->
        <!--
        <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-yuicompressor</artifactId>
            <version>${tapestry-release-version}</version>
        </dependency>
        -->

        <!-- Uncomment this to add support for file uploads: -->
        <!--
         <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-upload</artifactId>
            <version>${tapestry-release-version}</version>
        </dependency>
        -->

        <!-- A dependency on either JUnit or TestNG is required, or the surefire plugin (which runs the tests)
        will fail, preventing Maven from packaging the WAR. Tapestry includes a large number
        of testing facilities designed for use with TestNG (http://testng.org/), so it's recommended. -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng-release-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>${easymock-release-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-test</artifactId>
            <version>${tapestry-release-version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Provided by the servlet container, but sometimes referenced in the application
        code. -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${servlet-api-release-version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Provide dependency to the Tapestry javadoc taglet which replaces the Maven component report -->
        <dependency>
            <groupId>org.apache.tapestry</groupId>
            <artifactId>tapestry-javadoc</artifactId>
            <version>${tapestry-release-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.1.Final</version>
        </dependency>
        <dependency>
            <groupId>unknown.binary</groupId>
            <artifactId>hibernate-jpa-2.1-api-1.0.0.Final</artifactId>
            <version>SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>TapestryApp</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <optimize>true</optimize>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7.2</version>
                <configuration>
                    <systemPropertyVariables>
                        <tapestry.execution-mode>Qa</tapestry.execution-mode>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <!-- Run the application using "mvn jetty:run" -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.16</version>
                <configuration>
                    <!-- Log to the console. -->
                    <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
                        <!-- This doesn't do anything for Jetty, but is a workaround for a Maven bug
                        that prevents the requestLog from being set. -->
                        <append>true</append>
                    </requestLog>
                    <systemProperties>
                        <systemProperty>
                            <name>tapestry.execution-mode</name>
                            <value>development</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting/>

    <repositories>

        <!-- This repository is only needed when the Tapestry version is a preview release, rather
        than a final release. -->
        <repository>
            <id>apache-staging</id>
            <url>https://repository.apache.org/content/groups/staging/</url>
        </repository>
        <repository>
            <id>unknown-jars-temp-repo</id>
            <name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>
            <url>file:${project.basedir}/lib</url>
        </repository>
    </repositories>

    <properties>
        <tapestry-release-version>5.4-beta-24</tapestry-release-version>
        <servlet-api-release-version>2.5</servlet-api-release-version>
        <testng-release-version>6.5.2</testng-release-version>
        <easymock-release-version>3.0</easymock-release-version>
        <slf4j-release-version>1.7.7</slf4j-release-version>

    </properties>
</project>

解决方法:

这个版本的tapestry-hibernate在maven central repository中都没有,在Apache staging repository中都没有(你在POM文件中引用它).

如果您想使用测试版,那么我建议您使用最新版本(例如this one).

编辑:

在您的POM文件的末尾,您有一个属性:

<tapestry-release-version>5.4-beta-24</tapestry-release-version>

将其更改为:

<tapestry-release-version>5.4-beta-28</tapestry-release-version>

EDIT2:

顺便说一句,您定义了以下两个依赖项:

<dependency>
    <groupId>org.apache.tapestry</groupId>
    <artifactId>tapestry-hibernate</artifactId>
    <version>${tapestry-release-version}</version>
</dependency>

目前没有任何伤害,但你最好清理它.

标签:java,hibernate,maven,tapestry
来源: https://codeday.me/bug/20190623/1274937.html