无法在 pom.xml中将包装作为战争添加到日食中的专家项目中

我是新手。我一直在用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.walmart.move.nim.damage</groupId>

 <artifactId>damages-external-services-parent</artifactId>

 <version>1.0.36-SNAPSHOT</version>

 <packaging>war</packaging> #### THIS LINE IS GIVING ERROR

</parent>

<artifactId>damages-external-services</artifactId>

<name>damages-external-services</name>

<description>Damages external services. This is the war.</description>

<properties>

<failOnMissingWebXml>false</failOnMissingWebXml>

<springframework.version>4.3.4.RELEASE</springframework.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <maven.javadoc.skip>true</maven.javadoc.skip>


</properties>

<dependencies>

    <dependency>

        <groupId>org.springframework</groupId>

        <artifactId>spring-test</artifactId>

        <version>${springframework.version}</version>

        <scope>test</scope>

    </dependency>

    <dependency>

        <groupId>org.apache.tomcat</groupId>

        <artifactId>tomcat-jdbc</artifactId>

        <version>7.0.62</version>

    </dependency>

    <dependency>

        <groupId>org.mockito</groupId>

        <artifactId>mockito-all</artifactId>

        <version>1.9.5</version>

        <scope>test</scope>

    </dependency>

    <dependency>

        <groupId>com.walmart.move.nim.damage</groupId>

        <artifactId>damages-utils</artifactId>

        <version>1.0.2214</version>

        <!-- <version>1.0.4-SNAPSHOT</version> -->

    </dependency>

</dependencies>


斯蒂芬大帝
浏览 68回答 2
2回答

慕神8447489

包装标签应在标签之外。<packaging></parent></parent> <packaging>war</packaging>

慕无忌1623718

母POM可以用包装pom声明。它并不意味着是分布式的,因为它只从其他项目中引用。Maven 父 pom 可以包含几乎所有内容,这些内容可以继承到子 pom 文件中,例如母体聚甲醛<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&nbsp; &nbsp; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;&nbsp; &nbsp; <modelVersion>4.0.0</modelVersion>&nbsp;&nbsp; &nbsp; <groupId>com.demo</groupId>&nbsp; &nbsp; <artifactId>Examples</artifactId>&nbsp; &nbsp; <version>0.0.1-SNAPSHOT</version>&nbsp; &nbsp; <packaging>pom</packaging>&nbsp;&nbsp; &nbsp; <name>Parent POM</name>&nbsp; &nbsp; <url>http://maven.apache.org</url>&nbsp;&nbsp; &nbsp; <properties>....儿童聚甲醛<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">&nbsp;&nbsp; &nbsp; <!--The identifier of the parent POM-->&nbsp; &nbsp; <parent>&nbsp; &nbsp; &nbsp; &nbsp; <groupId>com.demo</groupId>&nbsp; &nbsp; &nbsp; &nbsp; <artifactId>Examples</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; <version>0.0.1-SNAPSHOT</version>&nbsp; &nbsp; </parent>&nbsp;&nbsp; &nbsp; <modelVersion>4.0.0</modelVersion>&nbsp; &nbsp; <artifactId>Examples</artifactId>&nbsp; &nbsp; <name>Child POM</name>&nbsp; &nbsp; <packaging>jar</packaging>&nbsp;&nbsp; &nbsp; <dependencies>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;....更多参考 https://howtodoinjava.com/maven/maven-parent-child-pom-example/
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java