Maven plugin error in netbeans - java

I'm using macbook and netbeans to write javaFX applications and I am now facing problem with this.
On my windows PC same code is working fine and as expected, but on mac program starts and when i press button to call action it just freezes so I have to force quit and then I get following message.
Please note that code is working fine on my other computer.
------------------------------------------------------------------------
Building IgraRecima 1.0-SNAPSHOT
------------------------------------------------------------------------
--- exec-maven-plugin:1.2.1:exec (default-cli) # IgraRecima ---
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 13.684s
Finished at: Wed Aug 15 01:28:42 CEST 2018
Final Memory: 7M/309M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project IgraRecima: Command execution failed. Process exited with an error: 143 (Exit value: 143) -> [Help 1]
I was searching internet for answer and I could't get it right.

Not same version of Java on computers

Related

Maven Sonarqube plugin: Unable to execute SonarQube: Fail to get bootstrap index from server

I'm having an headache setting up the sonarqube maven plugin for a project.
So I have a sonarqube instance let's say on https://sonarqube.mycompany.software. I test many projects on this instance, it's working well since months.
I also have other projects that use the maven plugin (but use another docker image to run)
I start a new project, and of course I want to add to my automatic pipeline that checks the code with sonarqube.
Everything runs perfectly when I execute the maven plugin on my machine, with the OpenJdk-8:
$ mvn org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent clean test package
$ mvn sonar:sonar -Dsonar.projectKey=projectname -Dsonar.host.url=https://sonarqube.mycompany.software -Dsonar.login=youwishyouknew
[... Lots of output ...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.891 s
[INFO] Finished at: 2020-05-07T18:03:00+02:00
[INFO] ------------------------------------------------------------------------
Then I try to execute the exact same command with docker on the server (where the pipeline will run), using the maven:3.6.3-jdk-8 image, I get this error:
$ docker run -v `pwd`/m2cache:/root/.m2 -v `pwd`/sonarcache:/root/.sonar/cache -v`pwd`:`pwd` -w`pwd` maven:3.6.3-jdk-8 mvn sonar:sonar -Dsonar.projectKey=projectname -Dsonar.host.url=https://sonarqube.mycompany.software -Dsonar.login=youwishyouknew
[INFO]
[INFO] ---------------------------< software.mycompany:projectname >----------------------------
[INFO] Building projectname 2.3.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) # projectname ---
[INFO] User cache: /root/.sonar/cache
[ERROR] SonarQube server [https://sonarqube.mycompany.software] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.286 s
[INFO] Finished at: 2020-05-07T16:06:22Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project projectname: Unable to execute SonarQube: Fail to get bootstrap index from server: Broken pipe (Write 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
When I Execute this, absolutely nothing is happening in the Sonarqube logs (nothing moves at all in any log, while when I run it on my machine I find everything I expect to find.)
Furthermore, if I try to curl the sonarqube server from the docker image, it works! Tried with ping too.
$ docker run -v `pwd`/m2cache:/root/.m2 -v `pwd`/sonarcache:/root/.sonar/cache -v`pwd`:`pwd` -w`pwd` maven:3.6.3-jdk-8 curl https://sonarqube.mycompany.software
<!doctype html><html lang="en"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
[... And a lot more output ... ]
It responds with the sonarqube index page as I expect.
As far as I can see, there is no proxy setting in the docker maven image.
This is quite frustrating.
Has anybody any clue on what is going on here and how to fix this?
[EDIT] So I've tried many things, and one worked: using another docker image. In particular, I've tried all the available maven jdk-8 images available here: https://hub.docker.com/_/maven, and one actually worked, while all other failed: maven:3.6.3-ibmjava-8.
It looks like a java-8 related problem, since all JDK 11 images instead do work as expected. Unfortunately the project is in Java 8 and everything breaks when upgrading the JVM :-)
I leave this here as a work-around, but still, I would like to know why it fails with other docker images and how to fix this in the future.
I had this issue too with maven and gradle sonarqube analysis, i have only this issue with jdk8-u252+.
Maven 3.6.3 official image have jdk8-u262.
For me, with maven 3.5.2 it's ok (jdk-u232).
For the root cause, it could be the javax.net.ssl new features shipped in u252 : https://www.oracle.com/java/technologies/javase/8u251-relnotes.html

MojoExecutionException when trying to profile netbeans project

There's about a million bug reports regarding the issue on NetBeans bug tracker but none of them brought me a resolution.
The issue is that when I try to profile my program, like this:
I get this:
cd C:\MYSELF\programing\java\AutoCall\AutoClient; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_31" cmd /c "\"\"C:\\Users\\Jakub\\AppData\\Roaming\\NetBeans\\7.4\\maven\\bin\\mvn.bat\" -Dexec.args=\"-agentpath:C:/Users/Jakub/AppData/Roaming/NetBeans/7.4/lib/deployed/jdk16/windows-amd64/profilerinterface.dll=C:\\Users\\Jakub\\AppData\\Roaming\\NetBeans\\7.4\\lib,5140,10 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\\MYSELF\\programing\\java\\AutoCall\\AutoClient\\nbproject\\private\\profiler -classpath %classpath cz.autoclient.Main\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_31\\bin\\java.exe\" -DnetbeansProjectMappings= -Dmaven.ext.class.path=C:\\Users\\Jakub\\AppData\\Roaming\\NetBeans\\7.4\\maven-nblib\\netbeans-eventspy.jar org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...
------------------------------------------------------------------------
Building Auto Client 3.0
------------------------------------------------------------------------
--- exec-maven-plugin:1.2.1:exec (default-cli) # autoclient ---
Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 14)
Profiler Agent Error: Timed out trying to establish connection with client
Profiler Agent: Initializing...
Profiler Agent: Options: >C:\Users\Jakub\AppData\Roaming\NetBeans\7.4\lib,5140,10<
Profiler Agent: Initialized successfully
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 12.012s
Finished at: Sun Jan 03 20:57:36 CET 2016
Final Memory: 5M/75M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project autoclient: Command execution failed. Process exited with an error: -1 (Exit value: -1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
This error seems to happen at random - I had several successful profiling sessions, then it happened again.
I was having the same problem, when I tryed to start the netbeans profile to analyze memory, I got the follow message:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project saf-desktop: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -> [Help 1]
So, instead to run de profile mode, I started the application normally and then, I atached the profile mode in the currenty runnig main application.
Increase the timeout. Run netbeans with the following argument:
netbeans64.exe -J-Dprofiler.agent.connect.timeout=60
See https://blogs.oracle.com/nbprofiler/entry/tweaking_profiler_timeouts

Genymotion and Android Maven

I'm using IntelliJ for Android development. I'm using this project as a test project to make android app run on Genymotion:
https://github.com/nicokruger/android-maven-phonegap
I am able to run
$mvn android:dex
$mvn android:apk
However
$mvn android:emulator-start fails
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] Starting android emulator with script: /tmp/android-maven-plugin-emulator-start.sh
[INFO] Waiting for emulator start:5000
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.673 s
[INFO] Finished at: 2014-04-01T11:48:03+08:00
[INFO] Final Memory: 12M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:emulator-start (default-cli) on project test: MojoExecutionException: Timeout while waiting for emulator to startup. -> [Help 1]
This plugin is not meant to run non-SDK emulator. Plugin search for emulator executable under following path (as it can be found in code):
String emulatorPath = new File (
getAndroidSdk().getToolsPath(), parsedExecutable ).getAbsolutePath();

Running Maven project in Netbeans

Is there any way I can run Maven project in Netbeans not in a Maven way? Netbeans do it automatically but I just want to run program normally, as a typical Java project (to save time). I want output to look like this:
run:
Hello world!
BUILD SUCCESSFUL (total time: 0 seconds)
instead of this:
cd C:\Users\mbrnw_000\Documents\NetBeansProjects\mavenproject1; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_15" "\"C:\\Program Files\\NetBeans 7.3\\java\\maven\\bin\\mvn.bat\"" "-Dexec.args=-classpath %classpath pl.mbrnwsk.mavenproject1.App" "-Dexec.executable=C:\\Program Files\\Java\\jdk1.7.0_15\\bin\\java.exe" process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
Scanning for projects...
------------------------------------------------------------------------
Building mavenproject1 1.0-SNAPSHOT
------------------------------------------------------------------------
[resources:resources]
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\Users\mbrnw_000\Documents\NetBeansProjects\mavenproject1\src\main\resources
[compiler:compile]
Nothing to compile - all classes are up to date
[exec:exec]
Hello world!
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1.143s
Finished at: Fri May 03 16:27:09 CEST 2013
Final Memory: 6M/107M
------------------------------------------------------------------------
by turning on Compile on Save in project properties. However please note that in 7.4 (upcoming version) all execution will already be done by Maven exclusively.

Maven 3.0.5 + Windows 8 + jdk 7 issue

I trying to figure out what is happening with my maven. I have switch to windows 8 last days and found problem with building apps with maven (please see failure message at the bottom):
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.400s
[INFO] Finished at: Sat Apr 13 18:36:56 CEST 2013
[INFO] Final Memory: 18M/178M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Example: Could not resolve dep
endencies for project
(Here are lots of libs)
Could not transfer artifact com.sun.xml.bind:jaxb-impl:pom:2.2.4-1 from/to central (
http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org
refused: connect: Address is invalid on local machine, or port is not valid on
remote machine -> [Help 1]
When switched to java 6, eveything is working fine. I have even disabled windows firewall, without any success though. Maybe someone has faced with that problem?
Here is my environment:
Windows 8 x64
JDK 7u17 (check on both, x86 and x64)
Maven 3.0.5
Well the answer look is so simple that I'm embarrassed to give but... . As I have written above I have disabled firewall / antyvirus but without any effect. However I don't add java as a exception to my antyvirus, which is as it turns out, scanning my apps and don't allow some to access event if it's disabled... . That's wierd but adding an exception in AV helped. Sorry for bother....

Categories

Resources