Maven无法识别pom.xml中的“配置”标签

我想把它放在我的pom.xml-

<configuration>

<archive>

<manifest>

<mainClass>com.limetray.helper.App</mainClass>

</manifest>

</archive>

</configuration>

但收到此错误-

Malformed POM /home/rakesh/Desktop/limetray/lt-utils/pom.xml: Unrecognised tag: 'configuration' (position: START_TAG seen ...<url>http://maven.apache.org</url>\n  <configuration>... @10:18)  @ /home/rakesh/Desktop/limetray/lt-utils/pom.xml, line 10, column 18 -> [Help 2]

我的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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.limetray.helper</groupId>

<artifactId>maven-jar-plugin</artifactId>

<packaging>jar</packaging>

<version>1.0-SNAPSHOT</version>

<name>lt-utils</name>

<url>http://maven.apache.org</url>

<configuration>

<archive>

<manifest>

<mainClass>com.limetray.helper.App</mainClass>

</manifest>

</archive>

</configuration>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

<scope>test</scope>

</dependency>

</dependencies>

</project>

回答:

<configuration>您发布的摘录属于<plugin>标记内。具体来说,它属于Apache Maven

Jar插件内部。请参阅下面的示例,以了解您在做什么错。

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-jar-plugin</artifactId>

<version>3.0.2</version>

<configuration>

<archive>

<manifest>

<mainClass>com.limetray.helper.App</mainClass>

</manifest>

</archive>

</configuration>

</plugin>

</plugins>

</build>

请参阅此处的Apache Maven Jar插件文档:https : //maven.apache.org/plugins/maven-jar-

plugin/index.html

以上是 Maven无法识别pom.xml中的“配置”标签 的全部内容, 来源链接: utcz.com/qa/419295.html

回到顶部