idea 执行 mvn clean 的时候报错

版权声明: https://blog.csdn.net/qq_32157851/article/details/83856824

此时首先执行一下  mvn   compile,看看报不报错,如果不报错那么在  pom.xml中的  <build> 标签后面增加一句  

<defaultGoal>compile</defaultGoal>

如下

<build>
   <defaultGoal>compile</defaultGoal>
   <plugins>        <!-- <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> 
         </plugin> -->
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <executions>
            <execution>
               <id>copy</id>
               <phase>package</phase>
               <goals>
                  <goal>copy-dependencies</goal>
               </goals>
               <configuration>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
               </configuration>
            </execution>
         </executions>
      </plugin>
   </plugins>

</build>

2、此时如果执行mvn  clean install   还报错 ,那么查看 pom.xml的权限,看看自己的用户用没有权限,如果是 root 权限,那么别的用户执行mvn clean就会报错。

ll   pom.xml  

给自己的用户授权

chown -R   user1:user1   pom.xml  

此时就可以了

扫描二维码关注公众号,回复: 3982946 查看本文章

猜你喜欢

转载自blog.csdn.net/qq_32157851/article/details/83856824