简体   繁体   English

Maven无法识别pom.xml中的“ configuration”标记

[英]Maven not recognising 'configuration' tag in pom.xml

I am trying to put this in my pom.xml- 我试图把它放在我的pom.xml-

<configuration>
  <archive>
    <manifest>
  <mainClass>com.limetray.helper.App</mainClass>
    </manifest>
  </archive>
</configuration>

but getting this error- 但收到此错误-

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]

My 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/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>

The <configuration> snippet you have posted belongs inside a <plugin> tag. 您发布的<configuration>代码段属于<plugin>标记内。 Specifically, it belongs inside the Apache Maven Jar Plugin. 具体来说,它属于Apache Maven Jar插件内部。 Refer to the sample below to get an idea of what you are doing wrong. 请参阅下面的示例,以了解您在做什么错。

<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>

Refer to the Apache Maven Jar Plugin documentation here: https://maven.apache.org/plugins/maven-jar-plugin/index.html 请参阅此处的Apache Maven Jar插件文档: https : //maven.apache.org/plugins/maven-jar-plugin/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM