Genymotion and Android Maven - java

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();

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

Maven plugin error in netbeans

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

IDEA maven goal returns 'Process finished with exit code 1'

in Eclipse I do this :
and it works :
but in IDEA :
all I get is this :
I don't understand why it's not launching correctly.
I've done the same in Eclipse and IDEA :
Created project with
mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtifactId=ninja-servlet-jpa-blog-archetype
cd MY_INSTALLED_PROJECT
mvn clean install
mvn ninja:run
And finally, imported project as a Maven project
And now I'm clueless. Anyone know what I'm doing wrong?
Update : 2018-01-30, still haven't found the solution!
I don't have an answer, but did narrow down the problem. Seems the combination of using Maven 3.5.x (I tested with 3.5.0 and 3.5.2) with JIdea. Here's the command line generated by JIdea to perform "clean" lifecycle:
C:\Dev\GitHub\cas-server>C:\Dev\JavaTools\jdk1.8.0_131\bin\java -Dmaven.home=C:\Dev\JavaTools\apache-maven-3.5.2 -Dclassworlds.conf=C:\Dev\JavaTools\apache-maven-3.2.1\bin\m2.
conf -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.5\bin" -Dfile.encoding=UTF-8 -classpath "C:\Dev\JavaTools\apache-maven-3.2.1\boot\plexus-classworlds-2.5.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.5\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=13.1.5 -X clean
Here I changed just the maven.home to point to Maven 3.2.1 folder, but left all other maven path references pointing at Maven 3.5.2. That works:
C:\Dev\GitHub\cas-server>C:\Dev\JavaTools\jdk1.8.0_131\bin\java -Dmaven.home=C:\Dev\JavaTools\apache-maven-3.2.1 -Dclassworlds.conf=C:\Dev\JavaTools\apache-maven-3.5.2\bin\m2.conf -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.5\bin" -Dfile.encoding=UTF-8 -classpath "C:\Dev\JavaTools\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.5\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=13.1.5 clean
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cas-overlay 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # cas-overlay ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.390 s
[INFO] Finished at: 2018-02-26T15:12:06-05:00
[INFO] Final Memory: 6M/123M
[INFO] ------------------------------------------------------------------------
Add flag
-X
It's verbose mode.
And check maven settings (settings.xml) in Intellij IDEA.
Preferences / Maven / User Settings file

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.

Craftbukkit: mvn clean install error

I am fairly new to UNIX and i am trying to use CraftBukkit to run my Minecraft Server.
This is what I did:
$ git clone git://github.com/Bukkit/CraftBukkit.git
$ cd CraftBukkit
$ mvn clean install
This is the error I get...
sam#qntm:~/CraftBukkit$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building CraftBukkit
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/sam/CraftBukkit/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 133 source files to /home/sam/CraftBukkit/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Feb 08 17:42:57 MSK 2011
[INFO] Final Memory: 12M/151M
[INFO] ------------------------------------------------------------------------
Apologies if there is a really simple and obvious solution.
ensure that your JAVA-HOME variable is set to proper path. Here is described how to set it properly http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/

Categories

Resources