IntelliJ - 模块 xx 是从 Maven 导入的。重新导入后,对其配置所做的任何更改都可能会丢失是什么意思?

Kee*_*ool 8 java intellij-idea maven

IntelliJ 在模块中显示这些警告消息

在此处输入图像描述“模块 xx 是从 Maven 导入的。重新导入后,对其配置所做的任何更改都可能会丢失。” (注意,只有当我按下模块上的“应用”按钮时才会发生这种情况)

我想知道这具体是什么意思以及解决方案...

欲了解信息请点击这里:

<?xml version="1.0" encoding="UTF-8"?>
Run Code Online (Sandbox Code Playgroud)

4.0.0

<groupId>me.codingtime</groupId>
<artifactId>NetworkPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>NetworkPlugin</name>

<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <createDependencyReducedPom>false</createDependencyReducedPom>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
</build>

<repositories>
    <repository>
        <id>spigotmc-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>sonatype</id>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.17.1-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

And*_*rey 4

此错误意味着您不得使用 IDE UI 对话框修改项目结构和构建配置,例如项目依赖项、编译器设置、源/资源目录等。相反,您必须在 Maven pom.xml 文件中进行相应的更改。

否则,在IDE从 Maven 构建文件 (pom.xml)重新加载项目后,您将丢失在 IDE UI 中所做的所有此类更改。

  • 你最后怎么解决的? (2认同)