gpt4 book ai didi

java - 未能执行 AirportWeb 项目的目标

转载 作者:太空宇宙 更新时间:2023-11-04 10:08:03 25 4
gpt4 key购买 nike

I am facing issue at the time of maven install. Here is my parent POM file AirportSys/pom.xml

<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>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportSys</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>AirportRepo</module>
<module>AirportServices</module>
<module>AirportWeb</module>
</modules>

</project>

AirportRepo/pom.xml

<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>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportSys</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>AirportRepo</artifactId>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.2.0.RELEASE</spring.version>
<log4j.version>1.2.17</log4j.version>
<jdk.version>1.7.0</jdk.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<!-- Mysql jars -->
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>

<!-- Hibernate jars -->
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.4.Final</version>
</dependency>

<!-- SpringFramework jars -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.16.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<!-- Tiles jars -->
<!-- https://mvnrepository.com/artifact/org.apache.tiles/tiles-jsp -->
<dependency>

<groupId>org.apache.tiles</groupId>

<artifactId>tiles-jsp</artifactId>

<version>3.0.8</version>

</dependency>

<!-- Servlet jars -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>


</dependencies>
</project>

AirportServices/pom.xml

<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>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportSys</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>AirportServices</artifactId>

<dependencies>
<dependency>
<groupId>com.mavenDemo</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>AirportRepo</artifactId>
</dependency>
</dependencies>
</project>

AiportWeb/pom.xml

<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportSys</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>AirportWeb Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mavenDemo</groupId>
<artifactId>AirportServices</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>AirportWeb</finalName>
</build>
</project>

Here is error at the time of maven install-

[INFO] Scanning for projects...
[WARNING] The POM for com.mavenDemo:AirportServices:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal on project AirportWeb: Could not resolve dependencies for project com.mavenDemo:AirportWeb:war:0.0.1-SNAPSHOT: Could not find artifact com.mavenDemo:AirportServices:jar:0.0.1-SNAPSHOT ->

I have already added all the dependency what is the issue in this code.

最佳答案

关于错误消息

[ERROR] Failed to execute goal on project AirportWeb: 
Could not resolve dependencies for project
com.mavenDemo:AirportWeb:war:0.0.1-SNAPSHOT:
Could not find artifact com.mavenDemo:AirportServices:jar:0.0.1-SNAPSHOT

以及显示我们在 AirportWeb 目录中执行 mvn install 的注释。

那么正确的位置应该是父项目目录,AirportSys。因为它是所有子模块的父模块。 Maven 会将其与这些子模块一起安装,并使它们在我们的本地存储库中可用。

请访问以下内容了解更多信息,Guide to Working with Multiple Modules

关于java - 未能执行 AirportWeb 项目的目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52698677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com