gpt4 book ai didi

java - TEXT 后面必须紧跟着 END_TAG,而不是 START_TAG

转载 作者:行者123 更新时间:2023-12-01 11:17:22 29 4
gpt4 key购买 nike

我正在尝试在我的 local 中添加简单属性简介。

<profile>
<id>local</id>
<properties>
<property>
<name>localurl</name> // line 111, column 27 is "l"
<value>http://localhost:8080</value>
</property>
</properties>
</profile>

当我清理项目时,出现以下错误。

TEXT must be immediately followed by END_TAG and not START_TAG
(position: START_TAG seen ...<property>\n <name>...
@111:27) @ line 111, column 27

我在上面提到了行号profile片段。我不知道为什么会发生这种情况。我正在使用maven 3.3.3Java 1.8 .

我搜索了几篇文章和 this stackoverflow 中的问题,但没有多大帮助。

知道为什么会出现此错误吗?

编辑如果我评论 <property>部分,这个错误不会出现。

这是我的pom.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>org.springframework</groupId>
<artifactId>gs-messaging-stomp-websocket</artifactId>
<version>0.1.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.RELEASE</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>1.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-tcp</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-net</artifactId>
<version>1.1.6.RELEASE</version>
</dependency>

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.9.0</version>
</dependency>

<!-- Spring caching framework inside this -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>

<!-- Support for Ehcache and others -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.6</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3</version>
</dependency>
</dependencies>

<properties>
<java.version>1.8</java.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>local</id>
<properties>
<property>
<name>localurl</name>
<value>http://localhost:8080</value>
</property>
</properties>
</profile>
</profiles>
</project>

这是我运行 mvn clean -e 时得到的堆栈跟踪

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM /Users/karthik/IdeaProjects/Messages/pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<property>\n <name>... @111:27) @ line 111, column 27
@
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM /Users/karthik/IdeaProjects/Messages/pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<property>\n <name>... @111:27) @ line 111, column 27

at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] The project (/Users/karthik/IdeaProjects/Messages/pom.xml) has 1 error
[ERROR] Non-parseable POM /Users/karthik/IdeaProjects/Messages/pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<property>\n <name>... @111:27) @ line 111, column 27 -> [Help 2]
org.apache.maven.model.io.ModelParseException: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<property>\n <name>... @111:27)
at org.apache.maven.model.io.DefaultModelReader.read(DefaultModelReader.java:130)
at org.apache.maven.model.io.DefaultModelReader.read(DefaultModelReader.java:94)
at org.apache.maven.model.building.DefaultModelProcessor.read(DefaultModelProcessor.java:81)
at org.apache.maven.model.building.DefaultModelBuilder.readModel(DefaultModelBuilder.java:529)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:269)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:469)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:438)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:401)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<property>\n <name>... @111:27)
at org.codehaus.plexus.util.xml.pull.MXParser.nextText(MXParser.java:1101)
at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.parseProfile(MavenXpp3ReaderEx.java:3511)
at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.parseModel(MavenXpp3ReaderEx.java:2532)
at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.read(MavenXpp3ReaderEx.java:4350)
at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.read(MavenXpp3ReaderEx.java:560)
at org.apache.maven.model.io.DefaultModelReader.read(DefaultModelReader.java:121)
... 25 more

最佳答案

如果我这样做

<properties>
<localurl>http://localhost:8080</localurl>
</properties>

<profiles>
<profile>
<id>local</id>
<properties>
<localurl>http://localhost:8080</localurl>
</properties>
</profile>
</profiles>

这些工作正常。

关于java - TEXT 后面必须紧跟着 END_TAG,而不是 START_TAG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31652353/

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