Spring Boot Build Native Error during Compilation - spring

Error Logs and Explannation
Hello
I´ve installed boot native support and I am receiving an error.
This post is more to support and give information for the technical team to improve this beta version.
The project compiles without problem if we run "normally"
Command : mvn -Pnative spring-boot:build-image
POM
<project>
<parent>
<groupId>parent</groupId>
<artifactId>pom</artifactId>
<version>1.0</version>
<relativePath>/envconfigfiles/pom.xml</relativePath>
</parent>
<groupId>spring</groupId>
<artifactId>configuration.server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>configuration.server</name>
<description>Spring Configuration Server</description>
<dependencies>
<!-- Spring Config Server -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<!-- Tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>
Parent POM
<groupId>parent</groupId>
<artifactId>pom</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<description>Environment Parent POM</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/>
</parent>
<properties>
<apache.commons.lang3>3.8.1</apache.commons.lang3>
<apache.httpcomponents>4.3.4</apache.httpcomponents>
<hibernate.types.52>2.9.3</hibernate.types.52>
<io.springfox.swagger2>2.9.2</io.springfox.swagger2>
<io.springfox.swagger.ui>2.9.2</io.springfox.swagger.ui>
<io.swagger.annotations>1.5.20</io.swagger.annotations>
<io.swagger.bean.validators>2.9.2</io.swagger.bean.validators>
<java.version>11</java.version>
<jaxb-api>2.3.0</jaxb-api>
<jaxb-impl>2.3.0</jaxb-impl>
<jaxb-runtime>2.3.0</jaxb-runtime>
<javax.activation>1.1.1</javax.activation>
<junit.vintage.engine.version>5.3.2</junit.vintage.engine.version>
<maven.checkstyle.version>3.0.0</maven.checkstyle.version>
<maven.compiler.plugin>3.8.1</maven.compiler.plugin>
<maven.jacoco.plugin>0.8.2</maven.jacoco.plugin>
<maven.failsafe.plugin>2.22.2</maven.failsafe.plugin>
<maven.surefire.plugin>2.22.2</maven.surefire.plugin>
<mockito.core>3.11.0</mockito.core>
<postgresql>42.2.23</postgresql>
<projectlombok>1.18.20</projectlombok>
<puppycrawl.checkstyle.version>8.19</puppycrawl.checkstyle.version>
<spring-boot-admin.version>2.3.1</spring-boot-admin.version>
<spring-boot-admin-server-ui-login>1.5.7</spring-boot-admin-server-ui-login>
<spring-boot-admin-starter-client>2.4.1</spring-boot-admin-starter-client>
<spring-boot-starter-security>2.4.0</spring-boot-starter-security>
<spring-boot-spring-native>0.10.0</spring-boot-spring-native>
<spring-cloud.version>2020.0.3</spring-cloud.version>
<spring-cloud-starter-zipkin>2.2.8.RELEASE</spring-cloud-starter-zipkin>
<spring-native.version>0.10.1</spring-native.version>
</properties>
<!-- MVN PROFILES -->
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>${repackage.classifier}</classifier>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
</env>
</image>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-aot-maven-plugin</artifactId>
<version>${spring-native.version}</version>
<executions>
<execution>
<id>test-generate</id>
<goals>
<goal>test-generate</goal>
</goals>
</execution>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- Spring Admin Client -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring-boot-admin-starter-client}</version>
</dependency>
<!-- Spring Cloud Client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<!-- Spring Native AOT Client -->
<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-native</artifactId>
<version>${spring-boot-spring-native}</version>
</dependency>
<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-aot</artifactId>
<version>${spring-boot-spring-native}</version>
</dependency>
<!-- Spring Swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${io.springfox.swagger.ui}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>${io.swagger.bean.validators}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${io.swagger.annotations}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${io.springfox.swagger2}</version>
</dependency>
<!-- DB -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql}</version>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>${hibernate.types.52}</version>
</dependency>
<!-- Apache Libs -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${apache.commons.lang3}</version>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${projectlombok}</version>
</dependency>
<!--XML Additional -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb-impl}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb-runtime}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax.activation}</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-dependencies</artifactId>
<version>${spring-boot-admin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!--CheckStyle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.checkstyle.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${puppycrawl.checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<excludes>
</excludes>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>false</logViolationsToConsole>
<encoding>UTF-8</encoding>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!--Compiler With Lombok -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${projectlombok}</version>
</path>
</annotationProcessorPaths>
<useIncrementalCompilation>false</useIncrementalCompilation> <!-- https://issues.apache.org/jira/browse/MCOMPILER-209 -->
</configuration>
</plugin>
<!--Jacoco Test Report -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${maven.jacoco.plugin}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- SureFire - Run Unit Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin}</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
</dependencies>
<configuration>
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
<includes>
<include>**/*.class</include>
</includes>
<excludes>
<exclude>**/*_FT.java</exclude>
</excludes>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- Run Functional Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin}</version>
<executions>
<execution>
<id>api-tests</id>
<phase>none</phase>
<configuration>
<testSourceDirectory>src/test/java/functionaltests</testSourceDirectory>
<includes>
<include>**/*FT*</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
<useSystemClassLoader>false</useSystemClassLoader>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
<!-- Spring Boot -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeDevtools>false</excludeDevtools>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-release</id>
<name>Spring release</name>
<url>https://repo.spring.io/release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-release</id>
<name>Spring release</name>
<url>https://repo.spring.io/release</url>
</pluginRepository>
</pluginRepositories>
</project>
Error Log
14270573607ffcd469159237568469f010e2f97bd74f674f79c38364f'
[INFO] > Executing lifecycle version v0.11.3
[INFO] > Using build cache volume 'pack-cache-a930304ae2dd.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ===> DETECTING
[INFO] [creator] 5 of 12 buildpacks participating
[INFO] [creator] paketo-buildpacks/ca-certificates 2.3.2
[INFO] [creator] paketo-buildpacks/graalvm 6.2.2
[INFO] [creator] paketo-buildpacks/executable-jar 5.1.2
[INFO] [creator] paketo-buildpacks/spring-boot 4.4.2
[INFO] [creator] paketo-buildpacks/native-image 4.1.2
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Previous image with name "docker.io/library/configuration.server:0.0.1-SNAPSHOT" not found
[INFO] [creator] ===> RESTORING
[INFO] [creator] ===> BUILDING
[INFO] [creator]
[INFO] [creator] Paketo CA Certificates Buildpack 2.3.2
[INFO] [creator] https://github.com/paketo-buildpacks/ca-certificates
[INFO] [creator] Launch Helper: Contributing to layer
[INFO] [creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO] [creator]
[INFO] [creator] Paketo GraalVM Buildpack 6.2.2
[INFO] [creator] https://github.com/paketo-buildpacks/graalvm
[INFO] [creator] Build Configuration:
[INFO] [creator] $BP_JVM_VERSION 11.* the Java version
[INFO] [creator] Launch Configuration:
[INFO] [creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[INFO] [creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] GraalVM JDK 11.0.11: Contributing to layer
[INFO] [creator] Downloading from https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
[INFO] [creator] Verifying checksum
[INFO] [creator] Expanding to /layers/paketo-buildpacks_graalvm/jdk
[INFO] [creator] Adding 129 container CA certificates to JVM truststore
[INFO] [creator] GraalVM Native Image Substrate VM 11.0.11
[INFO] [creator] Downloading from https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/native-image-installable-svm-java11-linux-amd64-21.1.0.jar
[INFO] [creator] Verifying checksum
[INFO] [creator] Installing substrate VM
[INFO] [creator] Processing Component archive: /tmp/1ab725616fede21ad5ae900d00ec6d45753db6f6f4fe51a836d538c79d79614a/native-image-installable-svm-java11-linux-amd64-21.1.0.jar
[INFO] [creator] Installing new component: Native Image (org.graalvm.native-image, version 21.1.0)
[INFO] [creator] Writing env.build/JAVA_HOME.override
[INFO] [creator] Writing env.build/JDK_HOME.override
[INFO] [creator]
[INFO] [creator] Paketo Executable JAR Buildpack 5.1.2
[INFO] [creator] https://github.com/paketo-buildpacks/executable-jar
[INFO] [creator] Class Path: Contributing to layer
[INFO] [creator] Writing env.build/CLASSPATH.delim
[INFO] [creator] Writing env.build/CLASSPATH.prepend
[INFO] [creator]
[INFO] [creator] Paketo Spring Boot Buildpack 4.4.2
[INFO] [creator] https://github.com/paketo-buildpacks/spring-boot
[INFO] [creator] Class Path: Contributing to layer
[INFO] [creator] Writing env.build/CLASSPATH.append
[INFO] [creator] Writing env.build/CLASSPATH.delim
[INFO] [creator] Image labels:
[INFO] [creator] org.opencontainers.image.title
[INFO] [creator] org.opencontainers.image.version
[INFO] [creator] org.springframework.boot.version
[INFO] [creator]
[INFO] [creator] Paketo Native Image Buildpack 4.1.2
[INFO] [creator] https://github.com/paketo-buildpacks/native-image
[INFO] [creator] Build Configuration:
[INFO] [creator] $BP_NATIVE_IMAGE true enable native image build
[INFO] [creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS arguments to pass to the native-image command
[INFO] [creator] Native Image: Contributing to layer
[INFO] [creator] GraalVM 21.1.0 Java 11 CE (Java Version 11.0.11+8-jvmci-21.1-b05)
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] (clinit): 2,872.18 ms, 2.60 GB
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] (typeflow): 115,047.19 ms, 2.60 GB
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] (objects): 274,851.84 ms, 2.60 GB
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] (features): 11,603.11 ms, 2.60 GB
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] analysis: 409,017.77 ms, 2.60 GB
[INFO] [creator] [/layers/paketo-buildpacks_native-image/native-image/spring.configuration.server.Application:169] universe: 5,672.85 ms, 2.60 GB
[INFO] [creator] Error: Image build request failed with exit status 137
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to contribute native-image layer
[INFO] [creator] error running build
[INFO] [creator] exit status 137
[INFO] [creator] ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:15 min
[INFO] Finished at: 2021-07-18T23:20:49+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) on project configuration.server: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image failed: Builder lifecycle 'creator' failed with status code 145 -> [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] `enter code here
[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/PluginExecutionException

Related

azure-functions-maven-plugin final jar missing libraries in classpath

I am try to deploy Java Azure function app from my local machine. My tech stack is fallows,
Azure Function App OS: Linux
Azure Functions Core Tools (2.0.3)
Springboot 2.6.3
spring-boot-maven-plugin 2.6.3
azure-functions-maven-plugin 1.14.3
azure-functions-java-library 1.4.2
spring-cloud-function-adapter-azure 3.2.1
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.avol.func</groupId>
<artifactId>springcloud-eh-func</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Azure Java Functions</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<azure.functions.maven.plugin.version>1.14.3</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<functionAppName>poc-java-func-apsp</functionAppName>
<resource.groupname>AvolPOCs</resource.groupname>
<appserviceplan.name>ASP-AvolPOCs-84f2</appserviceplan.name>
<azure.region>southcentralus</azure.region>
<azure.subscriptionid>xxxxxx</azure.subscriptionid>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.avol.func.SpringAppRunner</start-class>
</properties>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-azure</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-logback</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-dependencies</artifactId>
<version>3.2.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${stagingDirectory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
<subscriptionId>${azure.subscriptionid}</subscriptionId>
<!-- function app name -->
<appName>${functionAppName}</appName>
<!-- function app resource group -->
<resourceGroup>${resource.groupname}</resourceGroup>
<!-- function app service plan name -->
<appServicePlanName>${appserviceplan.name}</appServicePlanName>
<!-- function app region-->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-regions for all valid values -->
<region>${azure.region}</region>
<!-- function pricingTier, default to be consumption if not specified -->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-pricing-tiers for all valid values -->
<!-- <pricingTier></pricingTier> -->
<!-- Whether to disable application insights, default is false -->
<disableAppInsights>false</disableAppInsights>
<runtime>
<os>linux</os>
<javaVersion>11</javaVersion>
</runtime>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~4</value>
</property>
<property>
<name>FUNCTIONS_WORKER_RUNTIME</name>
<value>java</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>
${project.build.directory}/azure-functions/${functionAppName}
</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources
</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.3</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-thin-layout</artifactId>
<version>1.0.28.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Here is my maven build logs,
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.avol.func:springcloud-eh-func >----------------
[INFO] Building Azure Java Functions 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # springcloud-eh-func ---
[INFO] Deleting C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # springcloud-eh-func ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # springcloud-eh-func ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # springcloud-eh-func ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-dependency-plugin:3.2.0:copy-dependencies (copy-dependencies) # springcloud-eh-func ---
[INFO] Copying azure-functions-java-library-1.4.2.jar to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\lib\azure-functions-java-library-1.4.2.jar
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) # springcloud-eh-func ---
[INFO] Building jar: C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\springcloud-eh-func-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- azure-functions-maven-plugin:1.14.3:package (package-functions) # springcloud-eh-func ---
[INFO] Java home : C:/Users/padaldl/workspace/installedsws/zulu-11-azure-jdk_11.52.13-11.0.13-win_x64
[INFO] Artifact compile version : 11
[INFO]
[INFO] Step 1 of 8: Searching for Azure Functions entry points
[INFO] 2 Azure Functions entry point(s) found.
[INFO]
[INFO] Step 2 of 8: Generating Azure Functions configurations
[INFO] Generation done.
[INFO]
[INFO] Step 3 of 8: Validating generated configurations
[INFO] Validation done.
[INFO]
[INFO] Step 4 of 8: Saving host.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\host.json
[INFO]
[INFO] Step 5 of 8: Saving local.settings.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\local.settings.json
[INFO]
[INFO] Step 6 of 8: Saving configurations to function.json
[INFO] Starting processing function: uppercase
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\uppercase\function.json
[INFO] Starting processing function: assetSync
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\assetSync\function.json
[INFO]
[INFO] Step 7 of 8: Copying JARs to staging directoryC:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp
[INFO] Copied successfully.
[INFO] Step 8 of 8: Installing function extensions if needed
[INFO] Extension bundle specified, skip install extension
[INFO] Successfully built Azure Functions.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (copy-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- spring-boot-maven-plugin:2.6.3:repackage (repackage) # springcloud-eh-func ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.790 s
[INFO] Finished at: 2022-02-03T19:39:15+05:30
[INFO] ------------------------------------------------------------------------
Function App works fine in local from IntellIJ IDEA, and as well run through mvn azure-functions:run command.
When I run the jar using java command java -jar <> it fails with error No Class Definition found error.
mvn azure-functions:deploy succeeded without any issue, and am able to see functions created on azure, but when I trigger function it fails with 500 Internal Error.
I suspect function failing in azure due to external dependencies not added to classpath of jar. From the stackoverflow I found similar question here, suggestion is to go with maven assembly plugin, but my question is why should we use Assembly plugin when I am using springboot plugin?
Finally issue got resolved after installing Azure Functions Core Tools version 4.x through MSI installer on windows.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#v2
And it looks like azure functions refer /lib folder under staging directory when function triggers, it need not be springboot fat jar.

Compilation error after reconfigure maven .pom file to collect browserstack reports inside jenkins

I am trying to configure maven project with TestNG to get Browserstack Automate reports inside Jenkins builds following official manual https://www.browserstack.com/automate/jenkins
The full log is here https://codeshare.io/2KgwqX
But I am getting error:
[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project xxx: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: multiple points -> [Help 1]
My pom file looks like
<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.xxx</groupId>
<artifactId>xxx</artifactId>
<version>4.0.0</version>
<packaging>jar</packaging>
<properties>
<jdk.source.version>1.8.0_131</jdk.source.version>
<jdk.target.version>1.8.0_131</jdk.target.version>
</properties>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.browserstack</groupId>
<artifactId>automate-testassist</artifactId>
<version>0.7.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.5.0-b01</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.dev9</groupId>
<artifactId>webdriver-utils</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.0.pr4</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suitexml.file}</suiteXmlFile>
</suiteXmlFiles>
<systemPropertyVariables>
<profileId>${profileId}</profileId>
<config>${config}</config>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.browserstack</groupId>
<artifactId>automate-maven-plugin</artifactId>
<version>0.7.2-SNAPSHOT</version>
<configuration>
<source>${jdk.source.version}</source>
<target>${jdk.target.version}</target>
<complianceLevel>${jdk.source.version}</complianceLevel>
</configuration>
<executions>
<execution>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- profiles -->
<profiles>
<!--profile>
<id>allow-snapshots</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile-->
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>local</id>
<properties>
<profileId>local</profileId>
<suitexml.file>src/test/resources/testng.local.xml</suitexml.file>
<dataCollector>s16</dataCollector>
<scriptFile>xxx</scriptFile>
<pjID>xxx</pjID>
<environment></environment>
<config>local.conf.json</config>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<profileId>dev</profileId>
<dataCollector>s16</dataCollector>
<scriptFile>xxx</scriptFile>
<pjID>xxx</pjID>
<suitexml.file>src/test/resources/testng.xml</suitexml.file>
<environment></environment>
<config>parallel.conf.json</config>
</properties>
</profile>
<profile>
<id>staging</id>
<properties>
<profileId>staging</profileId>
<activeByDefault>true</activeByDefault>
<dataCollector>s16</dataCollector>
<scriptFile>xxx</scriptFile>
<pjID>xxx</pjID>
<suitexml.file>src/test/resources/testng.xml</suitexml.file>
<environment></environment>
<config>parallel.conf.json</config>
</properties>
</profile>
<profile>
<id>live</id>
<properties>
<profileId>live</profileId>
<dataCollector>s16</dataCollector>
<scriptFile>xxx</scriptFile>
<pjID>xxx</pjID>
<suitexml.file>src/test/resources/testng.xml</suitexml.file>
<environment></environment>
<config>parallel.conf.json</config>
</properties>
</profile>
</profiles>
The full output
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dmaven.multiModuleProjectDirectory=/home/xxx/repos/selenium-tests/xxx-tests -Dmaven.home=/home/xxx/.local/share/JetBrains/Toolbox/apps/xxx/ch-0/172.3317.53/plugins/maven/lib/maven3 -Dclassworlds.conf=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/plugins/maven/lib/maven3/bin/m2.conf -javaagent:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/lib/idea_rt.jar=34649:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/bin -Dfile.encoding=UTF-8 -classpath /home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.2 clean test -Plocal
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxx 4.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # xxx ---
[INFO] Deleting /home/xxx/repos/selenium-tests/xxx-tests/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # xxx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # xx ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 9 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java uses unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # xxx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # xxx ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 13 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/test-classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Some input files use unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) # xxx ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.969 s
[INFO] Finished at: 2017-07-14T16:47:29+02:00
[INFO] Final Memory: 30M/471M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project xxx: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: multiple points -> [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/PluginExecutionException
Process finished with exit code 1
The problem was just in java version as a string, I have changed to
<properties>
<jdk.source.version>1.8</jdk.source.version>
<jdk.target.version>1.8</jdk.target.version>
</properties>

org.apache.maven.plugins:maven-compiler-plugin Failed

After one day effort and reading many topics about that, I have still the problem! I use Debian 8 jessie and used the below command to install maven:
apt-get install maven
and this is th result of this command: mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-4-amd64", arch: "amd64", family: "unix"
I also used this : git clone https://bitbucket.org/axelclk/info.bliki.wiki.git
to get the bliki. and I went to it's directory and tried this command:
mvn install -DskipTests
but i got this results:
root#localhost:/home/m/info.bliki.wiki# mvn install -DskipTests
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 4 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Bliki POM
[INFO] Bliki (Core)
[INFO] Bliki (PDF)
[INFO] Bliki (Addons)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Bliki POM 3.1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.3:jar (attach-javadocs) # bliki ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-source-plugin:3.0.0:jar-no-fork (attach-sources) # bliki ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # bliki ---
[INFO] Installing /home/m/info.bliki.wiki/pom.xml to /root/.m2/repository/info/bliki/wiki/bliki/3.1.1-SNAPSHOT/bliki-3.1.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Bliki (Core) 3.1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.4.0:exec (git submodule update) # bliki-core ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # bliki-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 25 resources
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # bliki-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 273 source files to /home/m/info.bliki.wiki/bliki-core/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # bliki-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 35 resources
[INFO] Copying 141 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # bliki-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 95 source files to /home/m/info.bliki.wiki/bliki-core/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/api/query/ParseTest.java:[15,9] cannot access java.util.concurrent.CompletableFuture
class file for java.util.concurrent.CompletableFuture not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/extensions/scribunto/engine/lua/LuaTestBase.java:[65,17] cannot access java.util.Optional
class file for java.util.Optional not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[12,9] cannot access java.util.OptionalDouble
class file for java.util.OptionalDouble not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[20,9] cannot access java.util.OptionalInt
class file for java.util.OptionalInt not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[25,9] cannot access java.util.OptionalLong
class file for java.util.OptionalLong not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[31,9] cannot access java.time.ZonedDateTime
class file for java.time.ZonedDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[36,9] cannot access java.time.LocalDateTime
class file for java.time.LocalDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[41,9] cannot access java.time.OffsetDateTime
class file for java.time.OffsetDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[46,9] cannot access java.time.OffsetTime
class file for java.time.OffsetTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[51,9] cannot access java.time.LocalTime
class file for java.time.LocalTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[56,9] cannot access java.time.LocalDate
class file for java.time.LocalDate not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[62,9] cannot access java.util.stream.Stream
class file for java.util.stream.Stream not found
[INFO] 12 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Bliki POM ......................................... SUCCESS [3.093s]
[INFO] Bliki (Core) ...................................... FAILURE [14.456s]
[INFO] Bliki (PDF) ....................................... SKIPPED
[INFO] Bliki (Addons) .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.122s
[INFO] Finished at: Fri Sep 30 21:30:18 IRST 2016
[INFO] Final Memory: 25M/227M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project bliki-core: Compilation failure: Compilation failure:
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/api/query/ParseTest.java:[15,9] cannot access java.util.concurrent.CompletableFuture
[ERROR] class file for java.util.concurrent.CompletableFuture not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/extensions/scribunto/engine/lua/LuaTestBase.java:[65,17] cannot access java.util.Optional
[ERROR] class file for java.util.Optional not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[12,9] cannot access java.util.OptionalDouble
[ERROR] class file for java.util.OptionalDouble not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[20,9] cannot access java.util.OptionalInt
[ERROR] class file for java.util.OptionalInt not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[25,9] cannot access java.util.OptionalLong
[ERROR] class file for java.util.OptionalLong not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[31,9] cannot access java.time.ZonedDateTime
[ERROR] class file for java.time.ZonedDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[36,9] cannot access java.time.LocalDateTime
[ERROR] class file for java.time.LocalDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[41,9] cannot access java.time.OffsetDateTime
[ERROR] class file for java.time.OffsetDateTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[46,9] cannot access java.time.OffsetTime
[ERROR] class file for java.time.OffsetTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[51,9] cannot access java.time.LocalTime
[ERROR] class file for java.time.LocalTime not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[56,9] cannot access java.time.LocalDate
[ERROR] class file for java.time.LocalDate not found
[ERROR] /home/m/info.bliki.wiki/bliki-core/src/test/java/info/bliki/wiki/filter/HTTPUrlFilterTest.java:[62,9] cannot access java.util.stream.Stream
[ERROR] class file for java.util.stream.Stream not found
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :bliki-core
I am newbie in Linux and don't know alot about it's commands and Errors! I also Added these lines to my pom.XML file but it had no sense!
<dependencies>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
This is my pom.XML file contents:
<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>info.bliki.wiki</groupId>
<artifactId>bliki</artifactId>
<packaging>pom</packaging>
<name>Bliki POM</name>
<version>3.1.1-SNAPSHOT</version>
<description>
The Bliki API is a Java-based Wiki to HTML renderer with MediaWiki syntax support.
</description>
<url>https://bitbucket.org/axelclk/info.bliki.wiki</url>
<organization>
<name>Java Wikipedia API (Bliki engine)</name>
<url>https://bitbucket.org/axelclk/info.bliki.wiki</url>
</organization>
<developers>
<developer>
<id>axelclk</id>
<name>Axel Kramer</name>
</developer>
<developer>
<id>jberkel</id>
<name>Jan Berkel</name>
</developer>
</developers>
<scm>
<connection>scm:git:https://bitbucket.org/axelclk/info.bliki.wiki.git</connection>
<developerConnection>scm:git:ssh://git#bitbucket.org/axelclk/info.bliki.wiki.git</developerConnection>
<tag>master</tag>
<url>https://bitbucket.org/axelclk/info.bliki.wiki/src</url>
</scm>
<issueManagement>
<system>Bitbucket</system>
<url>https://bitbucket.org/axelclk/info.bliki.wiki/issues</url>
</issueManagement>
<ciManagement>
<url>https://drone.io/bitbucket.org/axelclk/info.bliki.wiki</url>
</ciManagement>
<licenses>
<license>
<name>Eclipse Public License 1.0</name>
<url>http://www.opensource.org/licenses/eclipse-1.0.php</url>
<distribution>repo</distribution>
</license>
<license>
<name>GNU Lesser General Public License - v 2.1 or later</name>
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>bliki-core</module>
<module>bliki-pdf</module>
<module>bliki-addons</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-pdf</artifactId>
<version>3.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-addons</artifactId>
<version>3.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.luaj</groupId>
<artifactId>luaj-jse</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.betamax</groupId>
<artifactId>betamax-junit</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-Werror</arg>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>#{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<configuration>
<connectionType>developerConnection</connectionType>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<serverId>sonatype-oss-staging</serverId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<argLine>-Dio.netty.leakDetectionLevel=simple -Dfile.encoding=UTF-8</argLine>
<!--<excludedGroups>info.bliki.annotations.IntegrationTest</excludedGroups>-->
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>sonatype-oss-staging</id>
<url>https://oss.sonatype.org/content/repositories/staging</url>
</repository>
<snapshotRepository>
<id>sonatype-oss-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
</project>
<dependencies>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
You are using Java version 1.7.
java.util.concurrent.CompletableFuture, java.util.Optional, java.util.OptionalDouble, java.time.ZonedDateTime, etc are all new features introduced in Java 1.8. They are not present in Java 1.7.
To get rid of these errors, update your Java version to 1.8.

Issues with maven compiler

I am trying to use jetty plugin for a grails project. I am currently using jdk 1.6.0_45. It seems that the jre version used by jdk 1.6 is a little old one for jetty plugin and it generates the following error.
Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/plus/webapp/EnvConfiguration : Unsupported major.minor version 51.0 (Use --stacktrace to see the full trace)
To resolve this error I have added a code in the pom.xml to use java source 1.7. The code is something like this.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
But still I continue to get the same error. Can any body please help me out.
I am posting my entire pom.xml and the error that I am getting
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>com.mycompany</groupId>
<artifactId>grails-mongo-demo</artifactId>
<packaging>grails-app</packaging>
<version>0.1</version>
<name>grails-mongo-demo</name>
<description>grails-mongo-demo</description>
<properties>
<grails.version>2.4.2</grails.version>
<h2.version>1.3.170</h2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-dependencies</artifactId>
<version>${grails.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-test</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-testing</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-datastore-test-support</artifactId>
<version>1.0-grails-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>scaffolding</artifactId>
<version>2.1.2</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>cache</artifactId>
<version>1.1.7</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>asset-pipeline</artifactId>
<version>1.8.11</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>webxml</artifactId>
<version>1.4.1</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>mongodb</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jetty</artifactId>
<version>3.0.0</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<pluginManagement />
<plugins>
<!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>plugins</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>grails</id>
<name>grails</name>
<url>http://repo.grails.org/grails/core</url>
</repository>
<repository>
<id>grails-plugins</id>
<name>grails-plugins</name>
<url>http://repo.grails.org/grails/plugins</url>
</repository>
</repositories>
<profiles>
<profile>
<id>tools</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Error
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building grails-mongo-demo 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # grails-mongo-demo ---
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongo-demo/target
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongo-demo/plugins (includes = [**/*], excludes = [])
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:clean (default-clean) # grails-mongo-demo ---
4 Sep, 2014 6:28:00 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
4 Sep, 2014 6:28:00 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
|Loading Grails 2.4.2
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
....................
|Application cleaned.
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:validate (default-validate) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:init (default-init) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:config-directories (default-config-directories) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:maven-compile (default-maven-compile) # grails-mongo-demo ---
4 Sep, 2014 6:28:32 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
4 Sep, 2014 6:28:32 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
|Loading Grails 2.4.2
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
......
|Installing zip jetty-3.0.0.zip...
...
|Installed plugin jetty-3.0.0
.............
|Installing zip webxml-1.4.1.zip...
...
|Installed plugin webxml-1.4.1
.............
|Installing zip asset-pipeline-1.8.11.zip...
...
|Installed plugin asset-pipeline-1.8.11
..................
|Installing zip cache-1.1.7.zip...
...
|Installed plugin cache-1.1.7
..............
|Installing zip scaffolding-2.1.2.zip...
...
|Installed plugin scaffolding-2.1.2
..............
|Installing zip jquery-1.11.1.zip...
...
|Installed plugin jquery-1.11.1
..............
|Installing zip mongodb-3.0.2.zip...
...
|Installed plugin mongodb-3.0.2
...................
|Compiling 87 source files
.Error
|
Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/plus/webapp/EnvConfiguration : Unsupported major.minor version 51.0 (Use --stacktrace to see the full trace)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.500 s
[INFO] Finished at: 2014-09-04T18:28:42+05:30
[INFO] Final Memory: 10M/102M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.grails:grails-maven-plugin:2.4.3:maven-compile (default-maven-compile) on project grails-mongo-demo: Forked Grails VM exited with error -> [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

Maven Can't Compile

I'm new to maven and can't understand how to get some examples from a book I have (O'Reilly's "Enterprise JavaBeans 3.1") running. It says to use the command "mvn clean install" to run the examples, but things don't work for me. When I go the folder where the pom.xml is, I get the following feedback:
$ mvn clean install[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JBoss EJB 3.x Examples - Chapter 4: Calculator Service EJBs 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # jboss-ejb3-examples-ch04-firstejb ---
[INFO] Deleting /Users/jonathanpomper/Desktop/oreilly-ejb-6thedition-book-examples-master/ch04-firstejb/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0-beta-1:enforce (enforce-maven-environment) # jboss-ejb3-examples-ch04-firstejb ---
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # jboss-ejb3-examples-ch04-firstejb ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/jonathanpomper/Desktop/oreilly-ejb-6thedition-book-examples-master/ch04-firstejb/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # jboss-ejb3-examples-ch04-firstejb ---
[INFO] Compiling 11 source files to /Users/jonathanpomper/Desktop/oreilly-ejb-6thedition-book-examples-master/ch04-firstejb/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
/bin/sh: /bin/javac: No such file or directory
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.530s
[INFO] Finished at: Mon Mar 10 18:17:56 EDT 2014
[INFO] Final Memory: 27M/218M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project jboss-ejb3-examples-ch04-firstejb: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] /bin/sh: /bin/javac: No such file or directory
[ERROR] -> [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/MojoFailureException
I have tried following the help link it provides, but I am stuck…any help would be awesome! Thanks in advance!
EDIT: Here is the 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/maven-v4_0_0.xsd">
<!-- Parent Information -->
<parent>
<groupId>org.jboss.ejb3.examples</groupId>
<artifactId>jboss-ejb3-examples-build</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<!-- Model Version -->
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Information -->
<artifactId>jboss-ejb3-examples-ch04-firstejb</artifactId>
<name>JBoss EJB 3.x Examples - Chapter 4: Calculator Service EJBs</name>
<description>Example to accompany O'Reilly "Enterprise Java Beans 6th Edition" Chapter 4</description>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-spec-api</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- Arquillian Test Harness -->
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<type>zip</type>
<scope>test</scope>
</dependency>
<!--
HACK:
Currently the ARQ Managed Container is not exporting
all deps needed to run, at a minimum, jboss-threads
AS7-1557
-->
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-build</artifactId>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
</exclusion>
<exclusion>
<groupId>xalan</groupId>
<artifactId>serializer</artifactId>
</exclusion>
</exclusions>
</dependency>
<profile>
<!-- Declare the "Integration Test" Profile -->
<id>it</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<!-- Get AS and put into "target" -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>pre-integration-test</phase> <!-- So run before testing -->
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>${version.org.jboss.as.7}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Surefire -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<printSummary>true</printSummary>
<includes>
<include>**/*IntegrationTestCase.java</include>
</includes>
<forkMode>once</forkMode>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
The Java_Home was not set/set improperly. Working now!

Resources