Maven——Project configuration is not up-to-date with pom.xml问题

终于考完了,开始写web大作业,用Maven+SpringMVC+mybatis,这是一个朋友帮忙搭的框架,以前没接触过,遇到不少麻烦,写篇博客压压惊。


环境

windows 7 64bits
MyEclipse 10破解版


问题

Project configuration is not up-to-date with pom.xml
项目飘红,新建的Maven项目就出问题,让人无比蛋疼。


解决

直接鼠标移到错误处,提示有个quick fix,直接使用这个选项就OK~

Description Resource Path Location Type An error occurred while filtering resources TaskManagerWeb line 1 Maven Java EE Configuration Problem CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1 -> org.apache.maven:maven-plugin-api:jar:3.0 -> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2 -> org.codehaus.plexus:plexus-component-annotations:jar:1.7.1: ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.plexus:plexus-component-annotations:jar:1.7.1: UnresolvableModelException: Failure to transfer org.sonatype.forge:forge-parent:pom:10 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.sonatype.forge:forge-parent:pom:10 from/to central (https://repo.maven.apache.org/maven2): No connector factories available pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-core:jar:3.0, org.apache.maven:maven-settings:jar:3.0, org.apache.maven:maven-settings-builder:jar:3.0, org.apache.maven:maven-repository-metadata:jar:3.0, org.apache.maven:maven-model-builder:jar:3.0, org.apache.maven:maven-aether-provider:jar:3.0, org.sonatype.aether:aether-impl:jar:1.7, org.sonatype.aether:aether-spi:jar:1.7, org.sonatype.aether:aether-api:jar:1.7, org.sonatype.aether:aether-util:jar:1.7, org.codehaus.plexus:plexus-interpolation:jar:1.14, org.codehaus.plexus:plexus-classworlds:jar:2.2.3, org.codehaus.plexus:plexus-component-annotations:jar:1.7.1, org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3, org.sonatype.plexus:plexus-cipher:jar:1.4, org.apache.maven.shared:maven-shared-utils:jar:3.2.1, commons-io:commons-io:jar:2.5, org.apache.maven.shared:maven-shared-incremental:jar:1.1, org.codehaus.plexus:plexus-java:jar:0.9.10, org.codehaus.plexus:plexus-compiler-api:jar:2.8.4, org.codehaus.plexus:plexus-compiler-manager:jar:2.8.4, org.codehaus.plexus:plexus-compiler-javac:jar:2.8.4: Failure to transfer org.apache.maven:maven-core:jar:3.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-core:jar:3.0 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (execution: default-compile, phase: compile) pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /TaskManagerWeb line 63 Maven Project Build Lifecycle Mapping Problem Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix. TaskManagerWeb line 1 Maven Configuration Problem Project configurator "com.genuitec.eclipse.maven.wtp.hibernate.configurator.wtp" required by plugin execution "org.apache.maven.plugins:maven-war-plugin:3.2.3:war (execution: default-war, phase: package)" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration. pom.xml /TaskManagerWeb line 71 Maven Project Build Lifecycle Mapping Problem Project configurator "com.genuitec.eclipse.maven.wtp.spring.configurator.wtp" required by plugin execution "org.apache.maven.plugins:maven-war-plugin:3.2.3:war (execution: default-war, phase: package)" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration. pom.xml /TaskManagerWeb line 71 Maven Project Build Lifecycle Mapping Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 57 Java Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 69 Java Problem Unhandled exception type SQLException TaskController.java /TaskManagerWeb/src/main/java/com/taskmanager/controller line 80 Java Problem Unhan
05-30
[root@yfw ~]# cd /opt/openfire [root@yfw openfire]# # 1. 回到家目录,创建独立的插件项目 [root@yfw openfire]# cd ~ [root@yfw ~]# mkdir -p openfire-plugins/restapi-plugin/src/main/{java,resources} out.println("🛑 REST API Plugin 已[root@yfw ~]# [root@yfw ~]# # 2. 进入项目根目录 [root@yfw ~]# cd openfire-plugins/restapi-plugin [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 3. 创建 pom.xml [root@yfw restapi-plugin]# cat > pom.xml << 'EOF' > <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>com.example.openfire.plugins</groupId> > <artifactId>restapi-plugin</artifactId> > <version>1.0.0-SNAPSHOT</version> > <packaging>jar</packaging> > <properties> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > <maven.compiler.source>17</maven.compiler.source> > <maven.compiler.target>17</maven.compiler.target> > <openfire.version>4.9.2</openfire.version> > </properties> > <dependencies> > <dependency> > <groupId>org.igniterealtime.openfire</groupId> > <artifactId>openfire</artifactId> > <version>${openfire.version}</version> > <scope>provided</scope> > </dependency> > </dependencies> > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>3.11.0</version> > <configuration> > <source>17</source> > <target>17</target> > </configuration> > </plugin> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-assembly-plugin</artifactId> > <version>3.6.0</version> > <executions> > <execution> > <phase>package</phase> > <goals> > <goal>single</goal> > </goals> > <configuration> > <descriptorRefs> > <descriptorRef>jar-with-dependencies</descriptorRef> > </descriptorRefs> > <finalName>${project.artifactId}-assembly</finalName> > <appendAssemblyId>false</appendAssemblyId> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > <resources> > <resource> > <directory>src/main/resources</directory> > <filtering>true</filtering> > <includes><include>plugin.xml</include></includes> > </resource> > <resource> > <directory>src/main/resources</directory> > <filtering>false</filtering> > <excludes><exclude>plugin.xml</exclude></excludes> > </resource> > </resources> > </build> > <repositories> > <repository> > <id>igniterealtime-repo</id> > <url>https://www.igniterealtime.org/repo/maven2/</url> > </repository> > </repositories> > </project> > EOF [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 4. 创建 plugin.xml [root@yfw restapi-plugin]# cat > src/main/resources/plugin.xml << 'EOF' > <?xml version="1.0" encoding="UTF-8"?> > <plugin> > <className>com.example.restapi.RestApiPlugin</className> > <name>REST API Plugin</name> > <description>Provides REST APIs.</description> > <author>Your Name</author> > <version>1.0.0</version> > <date>2025-10-03</date> > <minServerVersion>4.9.2</minServerVersion> > </plugin> > EOF [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 5. 创建 Java 类 [root@yfw restapi-plugin]# cat > src/main/java/com/example/restapi/RestApiPlugin.java << 'EOF' > package com.example.restapi; > > import org.jivesoftware.openfire.plugin.Plugin; > import org.jivesoftware.openfire.plugin.PluginManager; > import java.io.File; > > public class RestApiPlugin implements Plugin { > @Override > public void initializePlugin(PluginManager manager, File pluginDirectory) { > System.out.println("✅ REST API Plugin 已成功加载!"); > } > > @Override > public void destroyPlugin() { > System.out.println("🛑 REST API Plugin 已卸载。"); > } > } > EOF -bash: src/main/java/com/example/restapi/RestApiPlugin.java: No such file or directory [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 6. 构建项目 [root@yfw restapi-plugin]# mvn clean package [INFO] Scanning for projects... [INFO] [INFO] ------------< com.example.openfire.plugins:restapi-plugin >------------- [INFO] Building restapi-plugin 1.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/maven-compiler-plugin-3.11.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/maven-compiler-plugin-3.11.0.pom (9.8 kB at 5.3 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/39/maven-plugins-39.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/39/maven-plugins-39.pom (8.1 kB at 16 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/maven-compiler-plugin-3.11.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/maven-compiler-plugin-3.11.0.jar (66 kB at 94 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 12 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar (34 kB at 67 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.6.0/maven-assembly-plugin-3.6.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.6.0/maven-assembly-plugin-3.6.0.pom (15 kB at 32 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.6.0/maven-assembly-plugin-3.6.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/3.6.0/maven-assembly-plugin-3.6.0.jar (236 kB at 320 kB/s) Downloading from igniterealtime-repo: https://www.igniterealtime.org/repo/maven2/org/igniterealtime/openfire/openfire/4.9.2/openfire-4.9.2.pom Downloading from central: https://repo.maven.apache.org/maven2/org/igniterealtime/openfire/openfire/4.9.2/openfire-4.9.2.pom [WARNING] The POM for org.igniterealtime.openfire:openfire:jar:4.9.2 is missing, no dependency information available Downloading from igniterealtime-repo: https://www.igniterealtime.org/repo/maven2/org/igniterealtime/openfire/openfire/4.9.2/openfire-4.9.2.jar Downloading from central: https://repo.maven.apache.org/maven2/org/igniterealtime/openfire/openfire/4.9.2/openfire-4.9.2.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.672 s [INFO] Finished at: 2025-10-03T01:49:40+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project restapi-plugin: Could not resolve dependencies for project com.example.openfire.plugins:restapi-plugin:jar:1.0.0-SNAPSHOT: Could not find artifact org.igniterealtime.openfire:openfire:jar:4.9.2 in igniterealtime-repo (https://www.igniterealtime.org/repo/maven2/) -> [Help 1] [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/DependencyResolutionException [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 7. 部署到 Openfire [root@yfw restapi-plugin]# cp target/restapi-plugin-assembly.jar /opt/openfire/plugins/ cp: cannot stat 'target/restapi-plugin-assembly.jar': No such file or directory [root@yfw restapi-plugin]# [root@yfw restapi-plugin]# # 8. 查看日志 [root@yfw restapi-plugin]# tail -f /opt/openfire/logs/openfire.log at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) [netty-transport-4.1.108.Final.jar:4.1.108.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) [netty-transport-4.1.108.Final.jar:4.1.108.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) [netty-transport-4.1.108.Final.jar:4.1.108.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) [netty-transport-4.1.108.Final.jar:4.1.108.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.108.Final.jar:4.1.108.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.108.Final.jar:4.1.108.Final] at java.lang.Thread.run(Thread.java:829) [?:?] 2025.10.03 01:33:56.063 ERROR [socket_c2s-thread-8]: org.jivesoftware.openfire.nio.NettyConnection - Problem during connection close or cleanup io.netty.channel.StacklessClosedChannelException: null at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
最新发布
10-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值