Java Struts2标签可以';找不到

Java Struts2标签可以';找不到,java,eclipse,maven,struts2,maven-jetty-plugin,Java,Eclipse,Maven,Struts2,Maven Jetty Plugin,我来这里是想问一个别人已经问过的问题,但我找到的每一个答案都不能解决我的问题 我目前正在将struts2与maven和jetty-maven插件一起使用,但是eclipse在我的jsp文件中抛出错误,说它找不到/struts标记.tld文件 另外,当我启动jetty:run命令时,它会说: [ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.0.M2:run (default-cli) on projec

我来这里是想问一个别人已经问过的问题,但我找到的每一个答案都不能解决我的问题

我目前正在将
struts2
maven
jetty-maven插件一起使用,但是eclipse在我的
jsp
文件中抛出错误,说它找不到
/struts标记.tld
文件

另外,当我启动jetty:run命令时,它会说:

[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.0.M2:run (default-cli) on project starservice: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.3.0.M2:run failed: An API incompatibility was encountered while executing org.eclipse.jetty:jetty-maven-plugin:9.3.0.M2:run: java.lang.NoSuchMethodError: org.apache.logging.log4j.ThreadContext.getThreadContextMap()Lorg/apache/logging/log4j/spi/ReadOnlyThreadContextMap;
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.eclipse.jetty:jetty-maven-plugin:9.3.0.M2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/user/.m2/repository/org/eclipse/jetty/jetty-maven-plugin/9.3.0.M2/jetty-maven-plugin-9.3.0.M2.jar
[ERROR] urls[1] = file:/C:/Users/user/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/user/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[...]
[ERROR] urls[45] = file:/C:/Users/user/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.1/taglibs-standard-impl-1.2.1.jar
[ERROR] urls[46] = file:/C:/Users/user/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
还有pom

<groupId>xx.xx</groupId>
<artifactId>xxxxx</artifactId>

<packaging>war</packaging>
<version>1</version>


<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.5.10.1</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.2.7.Final</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.8</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>
</dependencies>

<build>
    <finalName>starserv</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <warName>${project.artifactId}</warName>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.0.M2</version>
            <configuration>
                <scanIntervalSeconds>5</scanIntervalSeconds>
                <war>${project.basedir}/target/${project.artifactId}.war</war>
                <webApp>
                    <webInfIncludeJarPattern>^$</webInfIncludeJarPattern>
                    <containerIncludeJarPattern>^$</containerIncludeJarPattern>
                </webApp>
            </configuration>
        </plugin>
    </plugins>
</build>
xx.xx
xxxxx
战争
1.
朱尼特
朱尼特
3.8.1
测试
org.apache.struts
struts2型芯
2.5.10.1
org.hibernate
冬眠核心
5.2.7.最终版本
org.apache.logging.log4j
log4j型芯
2.8
javax.servlet
javax.servlet-api
3.1.0
星服
maven编译器插件
3.6.1
1.8
1.8
org.apache.maven.plugins
maven战争插件
3.0.0
${project.artifactId}
假的
org.eclipse.jetty
jetty maven插件
9.3.0.2平方米
5.
${project.basedir}/target/${project.artifactId}.war
^$
^$


有人知道怎么修吗?因为什么都没用。

我发现了问题

您只需要将log4japi添加到struts中相同版本的log4j中。对我来说是

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.8.1</version>
</dependency>

org.apache.logging.log4j
log4japi
2.8.1

希望它能帮助别人

你能把你的pom和你的问题放在一起吗?
java.lang.NoSuchMethodError:org.apache.logging.log4j.ThreadContext.getThreadContextMap()Lorg/apache/logging/log4j/spi/ReadOnlyThreadContextMap我在@asettouf添加了它