且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Maven清除错误 - 请求的配置文件“pom.xml”无法激活,因为它不存在

更新时间:2022-12-05 22:17:36

警告信息

[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.

意味着你以某种方式传递了 -P pom.xml 到Maven,这意味着有一个名为 pom.xml 的配置文件;找到并激活它。检查您的环境以及此标志的 settings.xml ,并查看各种内部的所有< profile> 元素XML文件。

means that you somehow passed -P pom.xml to Maven which means "there is a profile called pom.xml; find it and activate it". Check your environment and your settings.xml for this flag and also look at all <profile> elements inside the various XML files.

通常, mvn help:effective-pom 对于查看真正的POM外观也很有用喜欢。

Usually, mvn help:effective-pom is also useful to see what the real POM would look like.

现在错误意味着你试图配置Maven来构建Java 8代码,但你没有使用Java 8运行时。解决方案:

Now the error means that you tried to configure Maven to build Java 8 code but you're not using a Java 8 runtime. Solutions:


  1. 安装Java 8

  2. 确保Maven使用Java 8(如果已安装)。 JAVA_HOME 是你的朋友

  3. pom.xml中配置Java编译器到实际拥有的Java版本。

  1. Install Java 8
  2. Make sure Maven uses Java 8 if you have it installed. JAVA_HOME is your friend
  3. Configure the Java compiler in your pom.xml to a Java version which you actually have.

相关:

  • Introduction to Build Profiles