Running ./mvnw package -Dnative followed by this error:
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:397)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:238)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
I've already ran another Quarkus project successfully in native mode without Jooq generation. I am very sure the problem is caused by Jooq. We are using the Jooq plugin in our pom.xml in such way:
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.16.4</version>
<executions>
<execution>
<id>jooq-codegen-exec1</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<jdbc>
<driver>org.mariadb.jdbc.Driver</driver>
<url>jdbc:mariadb://127.0.0.1:3306</url>
<user>admin</user>
<password>admin</password>
</jdbc>
<generator>
<database>
<includes>.*</includes>
<inputSchema>hvb3</inputSchema>
</database>
<target>
<packageName>hvbJooq</packageName>
<directory>src/main/java</directory>
</target>
</generator>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.0.3</version>
</dependency>
</dependencies>
</plugin>
Does anybody know anything about this issue?
I'm using jOOQ Pro Java 17 with Quarkus & GraalVM native mode for more than half a year in production, but personally I'm not using the Quarkiverse jOOQ extension as it is outdated and is rather difficult to work with jOOQ Express/Pro/Enterprise.
I'd like to keeps things up-to-date, my latest prod build is running with Quarkus 2.9.2.Final, jOOQ Pro 3.16.6 Java 17 and GraalVM 22.1.0 Java 17.
For building the microservices last year I switched from Maven to Gradle and luckily I did so, so I could write the following Gradle task that automatically registers all jOOQ generated POJOs, Records and Routines for GraalVM reflection before the GraalVM build is started.
quarkus native reflection configuration for whole package
I hope this helps.
My goal is to add an external jar into my Maven-project. Running the project invokes an NoClassDefFoundError. So I did a little research to found out that possibly the external jar is not included in my created jar file.
Therefor I found the solution to use maven-shade-plugin, but I'm stuck a little because the project will not compile.
I've got the following pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>this.isa.test</groupId>
<artifactId>test</artifactId>
<version>0.0.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version><!--change this value depending on the version or use LATEST-->
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version><!--change this value depending on the version-->
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
</project>
Note that maven-shade-plugin is referenced as a dependency and included as an plugin for the build. I'm compiling the project through the Eclipse IDE with the preinstalled maven integration like the following mvn-install.
The following Error messages will be given in the Console:
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-shade-plugin:jar:3.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.195 s
[INFO] Finished at: 2018-09-30T09:48:43+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:3.2 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-shade-plugin:jar:3.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[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/PluginResolutionException
To be honest, I'm a little overchallenged because it's my first attempt to use Maven. There are plenty of questions and answers here and all over the internet, but nothing seems to fit my situation.
I am not using Eclipse, but instead invoking maven from commandline - and for making the thing work, I would recommend the same to you.
Once you have maven build working, you can try the next challenge with Eclipse, which should not be hard anyway.
Your pom needs following fixes:
remove the shade plugin from dependencies; dependencies should contain only artifacts that are needed for javac to compile the project, in your case also artifacts needed in runtime, but never (with very few exceptions) maven tooling artifacts
fix the shade plugin version to 3.2.0 (you have it correctly in your dependency, but not in plugin declaration)
Then try mvn clean install on commandline (make sure you are in the same directory where your pom file exists) and it should work - at least it did for me.
I have a solution in IntelliJ that builds fine on my local.
Extract from the POM:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<dependencies>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
I have installed Jenkins on my local and created a simple Maven project and pointed it to my POM file from within Jenkins.
When I build the solution from Jenkins I get the following error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error resolving version for 'org.apache.maven.plugins:maven-surefire-plugin': Plugin requires Maven version 2.2.1
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
On Jenkins I have installed:
Maven Integration plugin
2.15.1
Any ideas / advice would be appreciated.
My own silly mistake. Had to specify the Maven and Java JDK under:
Manage Jenkins --> Global Tool Configuration
After this everything worked.
I want to update jenkins selenium plugin (latest version: 2.53.1).
I can configure selenium hub and nodes outside of jenkins and run my automated tests with latest browser versions (firefox 51.0.1, chrome 55.0.2883.87) successfully but I just want to use jenkins as hub.
So that's why I'm trying to integrate the newest version of the selenium-server-standalone (3.0.1) into Jenkins but it's not working.
Getting this error messages:
[WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:1.117 is missing, no dependency information available
[WARNING] Failed to build parent project for org.jenkins-ci.plugins:selenium:hpi:2.53.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO]Building Jenkins Selenium Plugin 2.53.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-hpi-plugin:1.117:validate (default-validate) # selenium ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:display-info (display-info) # selenium ---
[INFO] Maven Version: 3.3.9
[INFO] JDK Version: 1.8.0_121 normalized as: 1.8.0-121
[INFO] OS Info: Arch: amd64 Family: unix Name: linux Version: 4.4.0-62-generic
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (display-info) # selenium ---
[INFO] Restricted to JDK 1.7 yet org.seleniumhq.selenium:selenium-server-standalone:jar:3.0.1:compile contains org/openqa/selenium/chrome/ChromeDriver.class targeted to JDK 1.8
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with message:
Found Banned Dependency: org.seleniumhq.selenium:selenium-server-standalone:jar:3.0.1
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 11.325 s
[INFO] Finished at: 2017-02-15T16:42:25+01:00
[INFO] Final Memory: 62M/1133M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (display-info) on project selenium: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[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/MojoExecutionException
pom.xml of maven project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fake</groupId>
<artifactId>fake</artifactId>
<packaging>pom</packaging>
<version>${selenium.version}</version>
<name>fake</name>
<properties>
<selenium.short.version>3.0</selenium.short.version>
<selenium.version>${selenium.short.version}.1</selenium.version>
<htmlunit.driver.version>2.20</htmlunit.driver.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<get
src="http://selenium-release.storage.googleapis.com/${selenium.short.version}/selenium-server-standalone-${selenium.version}.jar"
dest="${project.build.directory}/selenium-server-standalone-${selenium.version}.jar"
verbose="on" usetimestamp="true" />
<get
src="https://github.com/SeleniumHQ/htmlunit-driver/releases/download/${htmlunit.driver.version}/htmlunit-driver-standalone-${htmlunit.driver.version}.jar"
dest="${project.build.directory}/htmlunit-driver-standalone-${htmlunit.driver.version}.jar"
verbose="on" usetimestamp="true" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>selenium-server-standalone</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${project.build.directory}/selenium-server-standalone-${selenium.version}.jar</file>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>${selenium.version}</version>
<packaging>jar</packaging>
<localRepositoryPath>local_m2</localRepositoryPath>
</configuration>
</execution>
<execution>
<id>htmlunit-driver-standalone</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${project.build.directory}/htmlunit-driver-standalone-${htmlunit.driver.version}.jar</file>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver-standalone</artifactId>
<version>${htmlunit.driver.version}</version>
<packaging>jar</packaging>
<localRepositoryPath>local_m2</localRepositoryPath>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Code : https://github.com/jenkinsci/selenium-plugin
OS: Ubuntu 16.04.2; Eclipse Neon Java IDE ,openjdk version "1.8.0_121"
I've already tried it out with openjdk 1.7 as well but it's still not working.
I'm quite a newbie at this so I appreciate any help. Thanks a lot.
The root cause is simple : The Jenkins plugin's parent pom enforces by default to JDK7. Selenium libraries have moved on to using JDK8. That explains the error message arising from the enforcer plugin.
Here's how the enforcer plugin has been configured in the parent pom
<java.level>7</java.level>
<enforceBytecodeVersion>
<maxJdkVersion>1.${java.level}</maxJdkVersion>
<ignoredScopes>
<ignoredScope>test</ignoredScope>
</ignoredScopes>
<excludes>
<!-- Makes no sense to check core itself: -->
<exclude>org.jenkins-ci.main:jenkins-core</exclude>
<exclude>org.jenkins-ci.main:cli</exclude>
<exclude>org.jenkins-ci.main:jenkins-test-harness</exclude>
<!-- findbugs dep managed to provided and optional so is not shipped and missing annotations ok -->
<exclude>com.google.code.findbugs:annotations</exclude>
</excludes>
</enforceBytecodeVersion>
To fix this, you have two options [ I have never tried this, but its something that you can try and see if it helps ] (Both these options I am suggesting based on the recommendations from your parent pom itself )
Try passing the JVM argument -Djava.level=8 when you build the code.
Add an entry such as below to your pom file (This will cause enforcer plugin to perhaps ignore only the selenium libraries)
maven-enforcer-plugin
display-info
org.seleniumhq.selenium:selenium-java::jar:compile
org.seleniumhq.selenium:selenium-server::jar:compile
Hope that helps!
update
I spent more time looking at this and realised that moving over to selenium 3.0.1 for this plug-in was not very straight forward. I have tried doing the changes and raised a pull request for the same. You can take a look at the PR and see if that helps.
PS : I still have 3 tests failing in the PR. I haven't figured out how to get them to pass. But the PR should help you get started. You can directly checkout my branch and try building from there.
I'm trying to use maven to build a jar but I keep getting the error
ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project Application: Fatal error compiling: invalid target release: 1.8 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[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/MojoExecutionException
mvn -v outputs
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T09:29:23-08:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"
So it looks like its pointing to the 1.6jdk
but I have the 1.8 jdk
java -version
java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
POM.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.brian.ridecellchallenge</groupId>
<artifactId>Application</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.group.id.Launcher1</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
</project>
Maven relies on the JAVA_HOME environment variable being set. Set it according to your OS and re-run your build.
Edit:
Use export to set the variable.
export JAVA_HOME=/path/to/java
As a MacOS user, open a Terminal and create or edit a file .bash_profile (in the directory of your user home) and put the following snippet there:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Save that file and reopen a Terminal instance. If you execute export as a command there, you should see a valid JAVA_HOME with the location of your JDK 8 installation. Restart your IDE afterwards and maven should be able to build you nice java target 1.8 code.
Because Maven does not know version of jdk you want to build.
You can try with
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
you can try configuration in compiler plugin. Its working on my local
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<executable><!--path-to-your-java8-home-directoru--></executable>
<compilerVersion>1.8</compilerVersion>
</configuration>
</plugin>
I noticed that it seems that maven-compiler-plugin ignores the configurations
<source>1.8</source>
<target>1.8</target>
In fact, building my project with -X maven's option, I see that in the configuration of the maven-compiler-plugin the source and target were forced to be 1.6:
[DEBUG] --------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<basedir default-value="${basedir}"/>
<buildDirectory default-value="${project.build.directory}"/>
<classpathElements default-value="${project.testClasspathElements}"/>
<compileSourceRoots default-value="${project.testCompileSourceRoots}"/>
<compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
<compilerReuseStrategy default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy} </compilerReuseStrategy>
<compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
<debug default-value="true">${maven.compiler.debug}</debug>
<debuglevel>${maven.compiler.debuglevel}</debuglevel>
<encoding default-value="${project.build.sourceEncoding}">UTF-8</encoding>
<executable>${maven.compiler.executable}</executable>
<failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
<forceJavacCompilerUse default-value="false">${maven.compiler.forceJavacCompilerUse}</forceJavacCompilerUse>
<fork default-value="false">${maven.compiler.fork}</fork>
<generatedTestSourcesDirectory default-value="${project.build.directory}/generated-test-sources/test-annotations"/>
<maxmem>${maven.compiler.maxmem}</maxmem>
<meminitial>${maven.compiler.meminitial}</meminitial>
<mojoExecution default-value="${mojoExecution}"/>
<optimize default-value="false">${maven.compiler.optimize}</optimize>
<outputDirectory default-value="${project.build.testOutputDirectory}"/>
<project default-value="${project}"/>
<session default-value="${session}"/>
<showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
<showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
<skip>${maven.test.skip}</skip>
<skipMultiThreadWarning default-value="false">${maven.compiler.skipMultiThreadWarning}</skipMultiThreadWarning>
<source default-value="1.5">1.6</source>
<staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
<target default-value="1.5">1.6</target>
<testSource>${maven.compiler.testSource}</testSource>
<testTarget>${maven.compiler.testTarget}</testTarget>
<useIncrementalCompilation default-value="true">${maven.compiler.useIncrementalCompilation}</useIncrementalCompilation>
<verbose default-value="false">${maven.compiler.verbose}</verbose>
I solved the problem after much much searches and tries, by forcing the java compiler to use the desired source and target:
<compilerArguments>
<source>1.8</source>
<target>1.8</target>
</compilerArguments>
This adds to the parameters of javac the two parameters above, overwriting the default.
In my case, all works well.
Just a note: I see that with the above configuration, maven calls the javac in this way:
-d [...] -g -nowarn -target 1.6 -source 1.6 -encoding UTF-8 -source 1.8 -target 1.8
The first two "-source" and "-target" parameters are the default parameters that the maven-compiler-plugin uses; the second couple of parameters are the parameters added by the plugin because of the configuration "compilerArguments" described above. It seems that javac just uses the last couple of parameters (if a parameter is repeated more times, the last one overwrites all the previouses), but I'm not sure that this can be considered a standard and "sure" behavior.
I used different versions of maven-compiler-plugin, different version of maven. I checked in deep all my configurations (e.g. system variables, every single script used in execution of java or maven and so on) and I'm sure that all is ok.
It's strange, but my conclusion is that there is a bug in the maven-compiler-plugin with java 8.
I'm not sure but can you try to update your maven.plugin version
try
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.6.1</version>
</plugin>
If anybody has Eclipse Kepler SR2 and has an issue with Java 1.8 while building project with Maven, try to go to Eclipse Marketplace and search for plugin called Java 8 support for m2e for Eclipse Kepler SR2 this helped me, and now Maven compiles Java 1.8 source without problem.
Yes it seems a bug in the maven-compiler-plugin.When I upgraded from 3.1 to 3.5.1, it works.