Maven BUILD FAILURE: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin


[INFO] Scanning for projects...
[INFO] Building csvexample 0.0.1-SNAPSHOT
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ csvexample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\code2care\eclipse-workspace\csvexample\src\main\resources
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ csvexample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\code2care\eclipse-workspace\csvexample\target\classes
[ERROR] COMPILATION ERROR : 
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[INFO] 2 errors 
[INFO] BUILD FAILURE
[INFO] Total time:  1.035 s
[INFO] Finished at: 2020-11-06T21:56:34+05:30
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5:compile
 (default-compile) on project csvexample: Compilation failure: 
Compilation failure: 
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

You can extract some important info from the above logs, "Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5, Source option 5 is no longer supported. Use 6 or later. Target option 1.5 is no longer supported. Use 1.6 or later." : Your build failed because either you missed to add maven plugin maven-compiler-plugin in your pom or added source or target below 1.5

How to fix this issue?

Add the following code in your pom.xml below </dependencies>.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>
Maven BUILD FAILURE - Failed to execute goal org.apache.maven.plugins - maven-compiler-plugin
Maven BUILD FAILURE - Failed to execute goal org.apache.maven.plugins - maven-compiler-plugin
Advertisements
Try Out Code2care Dev Tools:

Advertisements



Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Advertisements


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency