org.glassfish.javaeetutorial的不可解析的父POM:dukes-tutoring

问题描述 投票:1回答:2

我想在netbeans.for中设置公爵辅导项目,因为我有以下内容

配置-jdk8,netbeans 8.0.2,glassfish 4.1,apache-maven-3.3.3

我在我的glassfish目录中没有duke辅导项目tut-install / examples / case-studies所以我下载了java_ee_sdk-7u2.zip并在解压后我复制了公爵辅导项目并使用file-> open项目导入该项目在netbeans中 - >

但是当我去构建和运行项目时,我遇到了以下错误

[ERROR] Some problems were encountered while processing the POMs:
Non-resolvable parent POM for org.glassfish.javaeetutorial:dukes-tutoring:[unknown-version]: Failure to find org.glassfish.javaeetutorial:case-studies:pom:7.0.5 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 and 'parent.relativePath' points at wrong local POM @ line 4, column 13
 @ 
The build could not read 1 project -> [Help 1]

  The project org.glassfish.javaeetutorial:dukes-tutoring:[unknown-version] (/home/yogesh/Downloads/dukes-tutoring/pom.xml) has 1 error
    Non-resolvable parent POM for org.glassfish.javaeetutorial:dukes-tutoring:[unknown-version]: Failure to find org.glassfish.javaeetutorial:case-studies:pom:7.0.5 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 and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]

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/ProjectBuildingException
[Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

我的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>
    <parent>
        <artifactId>case-studies</artifactId>
        <groupId>org.glassfish.javaeetutorial</groupId>
        <version>7.0.5</version>
    </parent>
    <groupId>org.glassfish.javaeetutorial</groupId>
    <artifactId>dukes-tutoring</artifactId>
    <packaging>pom</packaging>
    <name>dukes-tutoring</name>
    <modules>
        <module>dukes-tutoring-common</module>
    </modules>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <skip>true</skip>
                    <executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>
                </configuration>
            </plugin>    
        </plugins>      
    </build>
</project>
java maven netbeans glassfish java-ee-7
2个回答
2
投票

我有同样的问题,我可以给你一些提示,也许它会有所帮助。

首先,您需要项目默认位于它所在的文件夹中,否则您需要对POM文件进行许多更改,因为很多配置都被引用到父POM文件中,例如glassfish主文件夹和版本以及许多其他内容。喜欢这一行:

<executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>

其次,按照提到的那样打开项目(因为项目在2个模块中有依赖项)“打开项目对话框,导航到:tut-install / examples / case-studies选择dukes-tutoring文件夹。选择Open Required Projects检查框,然后单击打开项目。“ ...

第三,用依赖关系构建项目(dukes-tutoring)。如果您使用的是netbeans,则可以右键单击该项目,然后单击“使用依赖项构建”

四,建成后运行glassfish服务器并使用mvn install部署项目(dukes-tutoring)。


0
投票

您还需要提取父项目。

在文件夹glassfish4\docs\javaee-tutorial中的java_ee_sdk-7u2.zip里面你必须在某处提取完整的examples文件夹。然后在此文件夹中打开dukes-tutoring项目。

欲了解更多信息,请阅读The Java EE Tutorial - Running the Duke's Tutoring Case Study Application

© www.soinside.com 2019 - 2024. All rights reserved.