【问题标题】:Unexpected element "{http://maven.apache.org/POM/4.0.0}project" {antlib:org.apache.tools.ant}project意外元素“{http://maven.apache.org/POM/4.0.0}project”{antlib:org.apache.tools.ant}project
【发布时间】:2021-09-22 11:39:11
【问题描述】:

这是我第一次尝试制作我的世界插件,我得到这个错误:

我不是程序员,所以有人能说一下为什么我进入 build.xml 时会出现这个错误吗?

Eclipse 版本:4.20.0

构建.xml

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

  <groupId>test.plugin.test</groupId>
  <artifactId>test</artifactId>
  <version>1.0-Complete</version>
  <packaging>jar</packaging>

  <name>main test</name>

  <description>test</description>
  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
</project>

【问题讨论】:

    标签: java eclipse maven minecraft


    【解决方案1】:

    错误消息表明读取文件的软件正在等待 Ant 内容,但发现了其他无法解释的内容。事实上,build.xml 是 Ant 使用的构建文件的典型名称,但显示的内容似乎是要保存为 Maven 使用的 pom.xml 文件。一个好的第一步可能是更正文件名;也许程序会以正确的心态阅读它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-20
      • 1970-01-01
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2022-08-22
      • 2016-12-13
      • 1970-01-01
      相关资源
      最近更新 更多