gpt4 book ai didi

java - 专家错误 : element dependency can not have character children

转载 作者:太空狗 更新时间:2023-10-29 22:31:10 25 4
gpt4 key购买 nike

我不确定发生了什么,但我项目的 POM 不再有效。它提示依赖元素。是依赖不再存在了吗?这个错误是什么意思?需要说明的是,我没有更改 POM,它现在不起作用。

确切的错误消息是 cvc-complex-type.2.3: Element 'dependency' cannot have character (children),因为此类型的内容类型是仅元素。

<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>com.medfusion</groupId>
<artifactId>Estatements-core</artifactId>
<version>14.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Estatements-core</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.group.id.Launcher1</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>nexus-qhg-dev</id>
<name>Medfusion repo</name>
<url>http://maven.qhg.local/nexus/content/groups/qhg-dev</url>
</repository>
</repositories>

<dependencies>
<dependency>
  <groupId>com.intuit.health</groupId>
<version>14.6.0-SNAPSHOT</version>
  <artifactId>notification-reference</artifactId>    
</dependency>
<dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
  </dependency>
<dependency>
    <groupId>com.intuit.health</groupId>
  <version>ihg-depot-trunk-SNAPSHOT</version>
  <artifactId>attachment-reference</artifactId>
  </dependency>
<dependency>
  <groupId>com.intuit.health</groupId>
  <version>ihg-depot-trunk-SNAPSHOT</version>
  <artifactId>eCommunication-core</artifactId>    
</dependency>
</dependencies>

</project>

最佳答案

Powerlord 的评论中所述,这个错误是由于XML文件解析不正确,因为a/some <dependency>...</dependency>之间有奇怪的隐藏字符标签。这些字符可能来自网络的复制粘贴。

要解决此问题,请删除 <dependency>...</dependency> 之间的所有空格和换行符标记定义并将它们放回您的编辑器中。

关于java - 专家错误 : element dependency can not have character children,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26508166/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com