Questions tagged [maven-compiler-plugin]

The Maven Compiler Plugin is used to compile the sources of your project. The default compiler is javac and is used to compile Java sources.

The Maven Compiler Plugin is used to compile the sources of your project.

The plugin always has a binding to the compile phase to compile application sources and to the test-compile phase to compile test sources.

Check the official usage page for a first look at this plugin.

More Info

293 questions
284
votes
6 answers

Specifying Java version in maven - differences between properties and compiler plugin

I'm not very experienced with Maven and while experimenting with multi-module project I started wondering how can I specify Java version for all my child modules in parent Maven pom. Until today I was using just:
Plebejusz
  • 3,332
  • 2
  • 19
  • 26
175
votes
33 answers

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)

I am using Maven 3.0.5 and Spring Tool Source 3.2 with Maven plugin installed. When I try to do 'Run As---> Maven install', I am getting the following error: [INFO] Scanning for projects... [INFO] …
Rushi Shah
  • 2,031
  • 2
  • 14
  • 10
127
votes
32 answers

Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

I have a maven project forked and cloned from a git repo onto my eclipse. It is build on Java 8. The first thing i do is perform a mvn clean install But I get following failure message: [INFO] Scanning for projects... [INFO] …
roger_that
  • 9,493
  • 18
  • 66
  • 102
118
votes
11 answers

Intellij maven project Fatal error compiling: invalid flag: --release

I am trying to start with Spring-boot, Maven in Intellij Please help me I am getting the error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-rest: Fatal error…
Aminul
  • 1,427
  • 2
  • 8
  • 16
98
votes
16 answers

Maven Out of Memory Build Failure

As of today, my maven compile fails. [INFO] [ERROR] Unexpected [INFO] java.lang.OutOfMemoryError: Java heap space [INFO] at java.util.Arrays.copyOfRange(Arrays.java:2694) [INFO] at java.lang.String.(String.java:203) [INFO] at…
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
46
votes
4 answers

Maven - exclude folder from build

Trying to exlcude a folder src/main/resources/scripts/ from my build but the following does not work: src/main/resources
Cheetah
  • 13,785
  • 31
  • 106
  • 190
45
votes
7 answers

Maven Build Failure - Compiler Plugin

I am trying to build a project in Maven and am experiencing the following error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project webgoat-container: Fatal error compiling:…
eliteparakeet
  • 739
  • 1
  • 5
  • 14
40
votes
3 answers

What does "Required filename-based automodules detected." warning mean?

In my multi-module project, I created module-info.java only for few modules. And during compilation with maven-compiler-plugin:3.7.0 I'm getting next warning: [WARNING] * Required filename-based automodules detected. Please don't publish this…
35
votes
5 answers

javax.annotation classes and Java 11 JDK

I am migrating from Java 8 to Java 11 and faced the problem. I should use: maven-compiler-plugin 2.5.1 with target 1.8 (compiling WAR in java8) tomcat9 Open JDK 11 But on startup gettings constant error: Post-processing of merged bean definition…
Sviatlana
  • 1,728
  • 6
  • 27
  • 55
33
votes
2 answers

Maven compiler recompile all files instead modified

Even if I only change one of my classes, Maven always recompiles all of them. I use this plugin configuration: org.apache.maven.plugins maven-compiler-plugin
Torsten
  • 21,726
  • 5
  • 24
  • 31
30
votes
2 answers

"maven.compiler.release" as an replacement for source and target?

I have two questions about maven.compiler.release-tag I want to replace 12 12 to
nimo23
  • 5,170
  • 10
  • 46
  • 75
30
votes
1 answer

--add-modules only on compilation

I'm building my project with maven and java-9. I've added in my pom.xml file: maven-compiler-plugin ${maven-compiler-plugin.version}
wbk
  • 1,310
  • 2
  • 11
  • 19
30
votes
4 answers

How do I disable the maven-compiler-plugin?

I have a maven project that uses the aspectj-compiler-plugin. I use intertype declarations so there are references to Aspect code in my Java code. Because of this, the maven-compiler-plugin fails to compile since it does not compile the aspect…
Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
28
votes
8 answers

How to configure Lombok with maven-compiler-plugin?

I have a root module and submodule in maven in the project. I am trying to use Lombok. I have added org.projectlombok lombok 1.16.12
Oleksandr Zaiats
  • 768
  • 2
  • 10
  • 15
23
votes
2 answers

IllegalAccessError when using a public method reference of a package-private class through a public subclass from another package

Yesterday I faced an interesting issue after deploying my Java 8 webapp on Tomcat 8. Rather than how to solve this issue I'm more interested in understanding why that happens. But let's start from the beginning. I have two classes defined as…
fabriziocucci
  • 782
  • 8
  • 20
1
2 3
19 20