Quarkus Getting Started project failed to produce native image - quarkus

I followed the instructions on https://quarkus.io/guides/building-native-image-guide but it failes with the error message "Failed to generate a native image"
I work on MacOS, having installed Maven 3.6.0.
The result of the command
mvn package -Pnative
ends up with the following error message:
Error: Error compiling query code (in /var/folders/cm/t91m64zj34d757jrhx6r3lz9kl946h/T/SVM-4468965107592954019/LibFFIHeaderDirectives.c). Compiler command gcc -I/Applications/graalvm-ce-1.0.0-rc14/Contents/Home/jre/lib/svm/clibraries/darwin-amd64/include /var/folders/cm/t91m64zj34d757jrhx6r3lz9kl946h/T/SVM-4468965107592954019/LibFFIHeaderDirectives.c -o /var/folders/cm/t91m64zj34d757jrhx6r3lz9kl946h/T/SVM-4468965107592954019/LibFFIHeaderDirectives output included error: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image building with exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.764 s
[INFO] Finished at: 2019-04-04T16:39:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:0.12.0:native-image (default) on project getting-started: Failed to generate a native image: Failed to build native image: Image generation failed -> [Help 1]
Any ideas what's the issue ?

Are you sure you installed the XCode CLI tools? This command will install them:
xcode-select --install

Related

How to "solve lambda expressions are not supported in -source 1.5 [ERROR]" when compiling within a jenkins docker

I'm trying to follow this jenkins tutorial:
https://www.youtube.com/watch?v=FonVQNqLWiE&list=PL6tu16kXT9PqIe2b0BGul-cXbmwGt7Ihw&index=7
but I'm trying to do that within a dockerized jenkins. To do so, instead of creating a windows virtual machine, I just run the official jenkins docker image:
$ docker pull jenkins/jenkins:lts
$ docker run -P jenkins/jenkins:lts
To follow it up to chapter #6, to make sure maven is available I enter into the container with this:
$ docker exec -it -u root amazing_bose bash
(amazing_bose is the random name that docker assigned to the machine) and then, inside it I do:
# apt-get update
# apt-get install maven
# which mvn
/usr/bin/mvn
# mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_232, vendor: Oracle Corporation
Java home: /usr/local/openjdk-8/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.9.184-linuxkit", arch: "amd64", family: "unix"
Build success
Until chapter #6 everything has worked fine. The repository is https://github.com/executeautomation/cucumberbasic and the compilation result in the docker's jenkins' console ends with:
Downloaded: https://repo.maven.apache.org/maven2/com/google/collections/google-collections/1.0/google-collections-1.0.jar (625 KB at 884.7 KB/sec)
[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 1 source file to /var/jenkins_home/workspace/TestJenkinsXavi/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.532 s
[INFO] Finished at: 2019-11-15T12:40:01+00:00
[INFO] Final Memory: 17M/115M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS
Build failure
Instead, in chapter #7, it proposes to build the verify maven target for this other project: https://github.com/executeautomation/SeleniumWithCucucumber
In here, in the video tutorial it successfully compiles, but when I do it I get this console ending:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.197 s
[INFO] Finished at: 2019-11-18T08:15:03+00:00
[INFO] Final Memory: 17M/160M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project CucumberBasics: Compilation failure: Compilation failure:
[ERROR] /var/jenkins_home/workspace/TestJenkinsXavi/src/main/java/com/ea/Main.java:[73,61] lambda expressions are not supported in -source 1.5
[ERROR] (use -source 8 or higher to enable lambda expressions)
[ERROR] /var/jenkins_home/workspace/TestJenkinsXavi/src/main/java/com/ea/Main.java:[118,50] method references are not supported in -source 1.5
[ERROR] (use -source 8 or higher to enable method references)
[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
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Question
So the question is:
As it is a closed container (jenkins/jenkins:lts) and it's a source code that is not mine (it's from the tutorial's author) I wonder what do I have to do to make it compile the verify target.
The solution is to specify the source and target JDK levels on the Maven invocation:
-Dmaven.compiler.source=8 -Dmaven.compiler.target=8
In Jenkins, click the "Advanced" button for the Maven build and add these options to the line labelled "MAVEN_OPTS".
Your build fails with
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project CucumberBasics: Compilation failure: Compilation failure:
[ERROR] /var/jenkins_home/workspace/TestJenkinsXavi/src/main/java/com/ea/Main.java:[73,61] lambda expressions are not supported in -source 1.5
[ERROR] (use -source 8 or higher to enable lambda expressions)
I assume your code has lambda functions in there. Try to execute your build with the -source 8 flag as specified in the log. That should fix the issue or at least give you the next issue to work on.

Error installing dl4j using maven

Sorry but I am very new to using Maven, trying to install dl4j for the provided examples via the following command, as per the instructions on the dl4j website:
mvn clean install -DskipTests -Dmaven.javadoc.skip=true
This proceeds somewhat, but then terminates with an error:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project dl4j-examples: Compilation failure: Compilation failure:
[ERROR] /Users/nick/Downloads/dl4j-examples/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/plot/PlotUtil.java:[158,13] cannot find symbol
[ERROR] symbol: method setDomainPannable(boolean)
[ERROR] location: variable plot of type org.jfree.chart.plot.XYPlot
[ERROR] /Users/nick/Downloads/dl4j-examples/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/plot/PlotUtil.java:[159,13] cannot find symbol
[ERROR] symbol: method setRangePannable(boolean)
[ERROR] location: variable plot of type org.jfree.chart.plot.XYPlot
[ERROR] -> [Help 1]
Now I have jfreechart library in a directory searchable by classpath, so, can someone help me resolve the above?
Running mac high sierra, on a 2016 macbook pro.
There is no need to build/install dl4j to run the examples.
Straight from the dl4j quickstart:
git clone https://github.com/deeplearning4j/dl4j-examples.git
cd dl4j-examples/
mvn clean install

Makefile for springboot application

I have a spring boot application.I am running it inside a vagrant box(centos).I use intelliJ IDEA.
I have created a Makefile and I am trying to run this application.
I have never worked with Makefile hence I am not confident about it.
Hence the question might seem easy for some of you.I tried to do a bit of research but I could not achieve any success in it.
My Makefile contains:-
install-mvn:
mvn :install
I opened a terminal and went to the location where my Makefile is located and then issue the 'make' command to run the application.
I get the error as below:-
[vagrant#localhost src]$ make
mvn :install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
[INFO] Total time: 0.578s
[INFO] Finished at: Fri Jul 14 17:24:31 IST 2017
[INFO] Final Memory: 4M/22M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal '' in plugin org.apache.maven.plugins:maven- install-plugin:2.3.1 among available goals install, install-file, help -> [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/MojoNotFoundException
make: *** [install-mvn] Error 1
I did not understand the error.Can any of you guide me with this?I would like to know what is being expected and what should the Makefile contain.
Thanks in advance

Maven build - surefire plugin error - File name too long

I was building project as usual with mvn clean install and following error happened:
(File name too long) -> [Help 1]
Full maven output:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:19 min
[INFO] Finished at: 2017-02-23T13:42:19+01:00
[INFO] Final Memory: 67M/544M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project union-sme-webapp: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: java.lang.RuntimeException: org.apache.maven.surefire.report.ReporterException: When writing report: /home/gondy/projects/xxxxxxx/xxxxxxxxx/webapp/target/surefire-reports/TEST-xx.xxxxx.xxxx.xxxx.webapp.service.document.generator.statics.arrangements.XxxxxxxxxxXxxxxxxXxxxxxxxxxxxXxxxxxxxXxxxxxxxxXxxx.xml (File name too long) -> [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.
I am working on Ubuntu 16.04 LTS. My colleagues are building the same project without any problem, it works even on Jenkins CI. What is the problem here? The filename is 144 chars long, which should be fine, ext has limit of 255 charactes.
The problem is, I have encrypted home directory and Ubuntu allows filename only 143 chars long:
From one of authors of eCryptfs:
Empirically, we have found that character filenames longer than 143 characters start requiring >255 characters to encrypt. So we (as eCryptfs upstream developers) typically recommend you limit your filenames to ~140 characters.
https://unix.stackexchange.com/a/32834/82647
So options basically are:
Make filename shorter by renaming methods and classes
Move your project outside encrypted directory
Remove encryption of your home directory
you can always disable file reporting via pom.xml file or console parameters
mvn clean install -Dsurefire.useFile=false -DredirectTestOutputToFile=false -DdisableXmlReport=true
Test results will be logged to console
Other way (untested by me) would be aggregating report, mentioned here maven surefire reporting plugin configuration

OpenTripPlanner getting started tutorial error

I'm trying to install OpenTripPlanner following the official tutorial.
I've correctly cloned the git repository, then I import the project in Eclipse but it is unable to build all the packages. One of the error is "The import org.geotools cannot be resolved"
So I've tryed with the Maven tutorial but when I run "mvn install integration-test -DskipTests -P interactive" I get:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.geotools:library:pom:null
Reason: Cannot find parent: org.geotools:modules for project: org.geotools:library:pom:null for project org.geotools:library:pom:null
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon May 20 15:53:31 CEST 2013
[INFO] Final Memory: 44M/473M
[INFO] ------------------------------------------------------------------------
Googling, I've not found anything similar, so, what's the matter?
seems that the geotools.version (and other) properties are not set in the main pom (https://github.com/openplans/OpenTripPlanner/blob/master/pom.xml).
Probably the hudson builder is using variables coming from the settings.xml.
Try defining it manually:
mvn install integration-test -DskipTests -Pinteractive -Dgeotools.version=9.1 -Dspring.version=3.1.1.RELEASE

Resources