首页 > 技术文章 > idea maven配置

chenjiafu 2020-06-17 13:47 原文

 maven版本3.6.3

 

 

1、新建系统环境变量JAVA_HOME变量值为C:\Program Files\Java\jdk-12.0.1

2、编辑Path添加%JAVA_HOME%\bin

3、新建系统环境变量CLASSPATH,变量值为.;%JAVA_HOME%\bin;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

maven 官网 https://mvnrepository.com/artifact/org.apache.maven.plugins

maven 环境变量配置:

 

 

 

 

 

 

 

问题解决

 


Some problems were encountered while building the effective model for com.xuxueli:xxl-job-executor-sample-springboot:jar:2.2.1-SNAPSHOT
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 86, column 21
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-resources-plugin is missing. @ line 133, column 21
'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 154, column 21
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.

 

maven 官网 https://mvnrepository.com/artifact/org.apache.maven.plugins

 

裝完maven后,package或clean时出错:
[WARN]
[WARN] Some problems were encountered while building the effective model 
 [WARN] 'build.plugins.plugin.version' is missing fororg.apache.maven.plugins:maven.compiler.plugin
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.

org.apache.maven.plugins:maven.compiler.plugin是一个plugin。可以通过“Add Denpendency”来添加。

在pom.xml中添加新的dependency:

 <dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<type>maven-plugin</type>
</dependency>
在build中添加:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

但是仍然有个错误,错误信息:build.plugins.plugin.version
可以看到,在pom.xml里面的<build>下面,沒有<version>。因此要多加一个version:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

好,解决问题。
————————————————
版权声明:本文为CSDN博主「白杨树」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hongchangfirst/article/details/7527063

 

spring-boot-maven-plugin not found的解决方案

 

通过IDE创建一个springboot项目

<plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>//这行红色
</plugin>

提示spring-boot-maven-plugin not found。在网上找了有说是通过添加<pluginRepositories>过解决,但是测试之后发觉不起作用。 经过多次尝试,最终spring-boot-maven-plugin指定版本后成功解决。 修改后的pom.xml文件

<plugin>  
 <groupId>org.springframework.boot</groupId>  
 <artifactId>spring-boot-maven-plugin</artifactId>  
 <version>2.2.2.RELEASE</version>
</plugin>

 无问题后,可以将<dependency>中的相关plugin注释掉,避免针对项目不必要的plugin包,生成到项目文件中。

推荐阅读