Maven Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (Defalut-compile) on project Project name: No Such compile ' javac '

Source: Internet
Author: User

This problem tangled up one day, in another computer is normal, but downloaded from the server to another computer when there is a problem

See Javac everyone would think of a compile problem, and the local configuration as shown:

Look at the configuration is consistent, where is the problem? Online consultation There is a great God who says it is possible that Maven did not configure the specified JDK cause for the following reasons:

  MAVEN is a project management tool, and if we don't tell it what version of the JDK our code is going to compile with, it will be processed with the default JDK version of Maven-compiler-plugin, which makes it prone to version mismatches. Problems that could lead to a compilation that does not pass. In order to deal with this situation, when building a MAVEN project, I was accustomed to the first step of configuring the Maven-compiler-plugin plugin. Workaround:

Specify the version used in Pom.xml 1 <build>

2         <plugins> 3             <plugin> 4                     <groupid>org.apache.maven.plugins</groupid > 5                     <artifactId>maven-compiler-plugin</artifactId>
 <!--use 3.5.1 is also correct do not know why if it is 3.0 is wrong, but Maven also has 3.0 version, may be related to my computer installed MAVEN version, local according to MAVEN version 3.0.5--
6               <version>3.1</version>7<configuration>8<defaultLibBundleDir>lib</defaultLibBundleDir>9 specify a high version of the source code and the compiled bytecode fileTen<source>1.6</source> One<target>1.6</target> A<optimize>true</optimize> -<debug>true</debug> -<showDeprecation>true</showDeprecation> the<showWarnings>true</showWarnings> -<encoding>utf-8</encoding> -</configuration> -</plugin> +              -</plugins> +</build>

After you have specified it, the computer will function properly.

Question 2:

1 [WARNING]2[WARNING] Some problems were encountered whileBuilding the effective model forCom.xxx.xxx:xxxx:jar:0.0.1-SNAPSHOT3[WARNING]'build.plugins.plugin.version'  forOrg.apache.maven.plugins:maven-compiler-plugin isMissing. @ Line the, column A 4 [WARNING]5[WARNING] It ishighly recommended to fix these problems because they threaten the stability of your build.6 [WARNING]7[WARNING] For Thisreason, future Maven versions might no longer support building such malformed projects.8[WARNING]

Compare official website usage: http://maven.apache.org/plugins/maven-compiler-plugin/usage.html

Initially configured:

1 <plugins>   2     <plugin>   3         <artifactId> Maven-compiler-plugin</artifactid>   4         <configuration>   5             < source>1.6</source>   6             <target>1.6</target>  7             <encoding>utf-8</encoding>   8         </ Configuration>   9     </plugin>  

The workaround for this problem is to require a sticky MAVEN version, the workaround:

1<plugins>2<plugin>3<artifactId>maven-compiler-plugin</artifactId>4<version>3.0</version>5<configuration>6<source>1.6</source>7<target>1.6</target>8<encoding>utf-8</encoding>9</configuration>Ten</plugin> One</plugins>

Maven Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (Defalut-compile) on project Project name: No Such compile ' javac '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.