Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven错误:";不可解析的POM:epilog中不允许使用开始标记;_Maven_Pom.xml - Fatal编程技术网

Maven错误:";不可解析的POM:epilog中不允许使用开始标记;

Maven错误:";不可解析的POM:epilog中不允许使用开始标记;,maven,pom.xml,Maven,Pom.xml,我正在使用Maven和BingAPI为一个类项目创建一个web搜索界面。当通过命令提示符编译文件时,我收到一个奇怪的错误 这是编译时的命令行结果: C:\Users\zacha\Desktop\java-project>mvn compile exec:java [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] N

我正在使用Maven和BingAPI为一个类项目创建一个web搜索界面。当通过命令提示符编译文件时,我收到一个奇怪的错误

这是编译时的命令行结果:

C:\Users\zacha\Desktop\java-project>mvn compile exec:java
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM C:\Users\zacha\Desktop\java-project\pom.xml: start tag not allowed in epilog but got b (position: END_TAG seen ...</build>\r\n</project>\r\n<b... @46:3)  @ line 46, column 3
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project  (C:\Users\zacha\Desktop\java-project\pom.xml) has 1 error
[ERROR]     Non-parseable POM C:\Users\zacha\Desktop\java-project\pom.xml: start tag not allowed in epilog but got b (position: END_TAG seen ...</build>\r\n</project>\r\n<b... @46:3)  @ line 46, column 3 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

C:\Users\zacha\Desktop\java-project>
C:\Users\zacha\Desktop\java project>mvn compile exec:java
[信息]正在扫描项目。。。
[错误][错误]处理POM时遇到一些问题:
[致命]不可解析的POM C:\Users\zacha\Desktop\java project\POM.xml:epilog中不允许使用开始标记,但获得了b(位置:已看到结束标记…\r\n\r\n[帮助1]
[错误]
[错误]项目(C:\Users\zacha\Desktop\java project\pom.xml)有1个错误
[错误]不可解析的POM C:\Users\zacha\Desktop\java project\POM.xml:epilog中不允许使用开始标记,但获得了b(位置:已看到结束标记…\r\n\r\n[帮助2]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[错误][帮助2]http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
C:\Users\zacha\Desktop\java项目>
下面是我的POM文件:

<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.websearch.web</groupId>
  <artifactId>java-project</artifactId>
  <version>1</version>
  <name>New Project Using SchemaCrawler</name>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>2.3.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>us.fatehi</groupId>
      <artifactId>schemacrawler</artifactId>
      <version>${schemacrawler.version}</version>
    </dependency>
  </dependencies>  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <schemacrawler.version>11.02.01</schemacrawler.version>
    <skip.signing.artifacts>true</skip.signing.artifacts>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>7</source>
          <target>7</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
<build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.4.0</version>
        <configuration>
          <!--Your comment
            Replace the mainClass with the path to your java application.
            It should begin with com and doesn't require the .java extension.
            For example: com.bingwebsearch.app.BingWebSearchSample. This maps to
            The following directory structure:
            src/main/java/com/bingwebsearch/app/BingWebSearchSample.java.
          -->
          <mainClass>com.WebSearch</mainClass>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
            <configuration>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
              <archive>
                <manifest>
                  <!--Your comment
                    Replace the mainClass with the path to your java application.
                    For example: com.bingwebsearch.app.BingWebSearchSample.java.
                    This maps to the following directory structure:
                    src/main/java/com/bingwebsearch/app/BingWebSearchSample.java.
                  -->
                  <mainClass>com.WebSearch.java</mainClass>
                </manifest>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>com.microsoft.azure</groupId>
      <artifactId>azure</artifactId>
      <version>1.9.0</version>
    </dependency>
    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
      <version>3.3</version>
    </dependency>
    <dependency>
      <groupId>com.microsoft.azure.cognitiveservices</groupId>
      <artifactId>azure-cognitiveservices-websearch</artifactId>
      <version>1.0.1</version>
    </dependency>
  </dependencies>

4.0.0
com.websearch.web
java项目
1.
使用SchemaCrawler的新项目
朱尼特
朱尼特
4.11
测试
org.hsqldb
hsqldb
2.3.2
假如
美国法蒂希
阴谋家
${schemacrawler.version}
UTF-8
11.02.01
真的
org.apache.maven.plugins
maven编译器插件
3.1
7.
7.
org.codehaus.mojo
execmaven插件
1.4.0
com.WebSearch
maven编译器插件
3
1.7
1.7
maven汇编插件
包裹
附属的
带有依赖项的jar
com.WebSearch.java
com.microsoft.azure
蔚蓝色的
1.9.0
公用网络
公用网络
3.3
com.microsoft.azure.cognitiveservices
azure认知服务Web搜索
1.0.1
我是新来的,似乎在这项任务中遇到了麻烦。我一直在学习微软网站上的教程。如果有任何帮助,我将不胜感激


提前感谢您抽出时间。

检查pom中“家长”标签的位置。
它应该位于“dependencies”结束标记之后。

问题是您有多个根(顶级)元素,而XML必须只有一个。在POM中,根元素是
。因此其他顶级元素应该移动到
中。然后您应该将多个
元素合并为一个

请了解更多关于XML的信息,并阅读说明每个元素可以包含哪些元素的文档。请尝试了解其结构,然后您可以自己解决此类问题。使用IDE将为您提供巨大帮助,因为它会在您编辑文件时指出错误,并且可能会建议解决方案

您的最终POM结构应如下所示:

<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.websearch.web</groupId>
  <artifactId>java-project</artifactId>
  <version>1</version>
  <name>New Project Using SchemaCrawler</name>
  <dependencies>
    <dependency>...</dependency>
    <dependency>...</dependency>
    ...
  </dependencies>  
  <properties>
    ...
  </properties>
  <build>
    <plugins>
      <plugin>...</plugin>
      <plugin>...</plugin>
      ...
    </plugins>
  </build>
</project>

4.0.0
com.websearch.web
java项目
1.
使用SchemaCrawler的新项目
...
...
...
...
...
...
...

例如,在
外部有一个
标记(它是根元素)。那么标签应该放在文件的最后吗?请看下面我的答案。我的pom中没有标签。应该包括吗?如果是,它包含什么?问题中没有
元素,有一个不会解决任何问题。我已按照您的建议重新格式化pom文件。我现在收到一个新错误。C:\Users\zacha\Desktop\java project>mvn compile exec:java[INFO]扫描项目…[ERROR][ERROR]处理POM时遇到一些问题:[致命]不可解析的POM C:\Users\zacha\Desktop\java project\POM.xml:无法识别的标记:“plugins”(位置:START\u tag seen…\r\n…@82:14)@第82行,第14列。不幸的是,有人告诉我,我的POM文件太长,无法在评论中发布,就像你在
中看到的
?那肯定没有意义。试着理解
插件和
插件的意思:
插件是列表,而
插件是列表项。再次,请阅读POM参考,它告诉您每个元素可以包含哪些元素。最后,如果您的新情况太长,无法发表评论,则应该是一个新问题。但是如果您尝试理解结构,您可以自己解决此类问题。IDE也可以提供巨大帮助。