Posts

Showing posts with the label maven

Maven Errors - Few common Maven error and troubleshooting part 2

In this post i am going to talk about maven build troubleshooting, Here is the list few maven error and its troubleshooting.  This is the part 2 of the Troubleshooting tips. concurrent.ExecutionException If you see following type of error in your release build. [ERROR] java.util.concurrent.ExecutionException: java.lang.NullPointerException   [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. Solution Your build job is having parellel execution, Please contact Release team to "-T -1C" get removed from the job. Docker image building failed due to Unable to locate package If you see following type of error in non java projects release build. [INFO] [91mE: Unable to locate package [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare (default-cli) on project : Mave...

Authentication Error while pulling images via docker-maven-plugin

docker-maven-plugin is the great plugin provided by spotify to build docker image during maven build. There is very strange error or behaviour I have seen during the image creation. Plugin expects that image which Dockerfile is pulling needs to be passed with username and password, which should not an essential parameter as most of the images does not need any auth to be downloaded.  You may see this error [INFO] Building image your-application:0.0.3 Step 1 : FROM ubunt:latest [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] your-application..................................... FAILUER [ 3.619 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 39.938 s (Wall Clock) [INFO] Finished at: 2016-06-25T16:26:06+00:00 [INFO] Final Memory: 65M/1216M [INF...

Sample gradle file

Following details are part of previous blog http://www.scmtechblog.net/2015/12/how-to-migrate-parent-pom-from-maven-to.html Here is the sample of base gradle file which can be acted as super pom for your project. There are 2 profiles we have enabled whitebox-analysis and Coverage-analysis which does complete checks and only jacoco respectively.

How to migrate Parent pom from maven to gradle

Convert Maven parent/super pom to Gradle init file When you think of moving to gradle for some reason from maven, You need to take care of lot of stuff around it, You can find lot of tools and help to convert maven pom.xml to gradle build.gradle But one of the most important task as an engineer or architect would be to convert your super pom (or parent pom) in to gradle init scripts. Gradle init script provides same functionality as Maven super/parent pom. The basic difference is that you can call init script Run time As many as of them This gives us flexibility to change the init script on run time but doubt of not tracking the changes.

Maven Errors - Few common Maven error and troubleshooting part 1

In this post i am going to talk about maven build troubleshooting, Here is the list few maven error and its troubleshooting. Tag Already exist If you see following type of error in your release build after the perform step [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project : Unable to tag SCM [ERROR] Provider message: [ERROR] The git-tag command failed. [ERROR] Command output: [ERROR] fatal: tag '<some tag>' already exists

Maven to gradle Migration

I am not a big fan of gradle but still this time i am taking this topic. Maven pom file is xml based build file and Gradle is groovy based system. There are many logic involve to make one to one comparison of generic features. I would like take some generic logic and try to detail out on converting those from maven pom file to gradle build file. Setup Modules define repositories upload of artifacts to maven repository Profiling jacoco test report use of release plugin

How to download Artifacts from maven repo

To make deployment automated, there may be need to get the artifacts from maven repo. Release artifacts can be downloaded since we know the version But how to download the latest snapshot artifacts. here are few http call to get  rid of such issues. How to download latest Snapshot artifact from nexus maven repo If you know the version you can directly get the artifact like this wget  http://<Your repo name>/service/local/artifact/maven/content?r=snapshots&g=com.&a=app&v=2.0.25-SNAPSHOT&p=war

Maven Tips to optimize build timings

Few Maven Tips and tricks to make Maven builds fast and faster and efficiently. This can help to reduce the build timings drastically and optimize your build timings Run compilation parallel mvn -T 2 clean compile #Above will trigger 2 threads mvn -T 1C clean install #Above will trigger 1 thread per CPU, if you have 2 CPU core then 2 threads will be spawned. #You can even give number in fraction (1.5, 2.5 etc).

Gradle or Maven - A Dilemma

Gradle and Maven (or Both) The world of build tools evolve from simple compilation (gcc) to make files, then evolution of ant(+ivy) and Maven, now the latest build tool is Gradle. Its always a puzzle which build tool to choose  maven, gradle or both (maven and gradle) . Sometime its first time project setup or could be migration from existing tool but it always a debate to choose one of the existing one. There have been lot of talks and discussion on Gradle, maven (and/or Gradle vs maven). There are Buzz around that Android/google adopted Gradle as its standard build tools.

Maven Repository tools Comparison

There are several maven repository tools available but biggest players are Artifactory and Nexus (sonatype).  I am taking these 2 repository provider tools for comparison. Artifactory and Nexus Summary Main purpose of this document is to compare the 2 maven repository providers (Tools). Artifactory Nexus (Sonatype) I am trying to review both repo managers. This is on basis of few points like features, cost, support etc.

Maven Findbugs error

Maven Findbugs error When you update your java version from 1.7 to 1.8 and if you are using findbugs in your pom You may see following error while running the build. [ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:2.5.3:findbugs (findbugs) on project : Execution findbugs of goal org.codehaus.mojo:findbugs-maven-plugin::findbugs failed: Java returned: 1 -> [Help 1] This is due to the mismatch of recent upgrade to java (1.8) and findbugs version. You will have to upgrade (start using) FindBugs verion 3.0.0 and above. Any findbugs version below 3.0.0 will not work with java 1.8.

Maven compiler error for invalid target java

Maven compiler error for invalid target java Some time you may see following error during maven compilation  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile) on project metamarket: Fatal error compiling: invalid target release: 1.8 or 1.7 or 1.6 -> [Help 1] This error is because, you system is set to use different version as default and source and target configuration is also set accordingly.

Build failing on sonar

With Maven 3+ we may face some issues while running sonar code coverage for the project in surefire plugin. Looks line may be bug in maven or surefire, can't say right now. Here is one of the weird error I have observed Exception in thread "main" java.lang.NoClassDefFoundError: ${surefire/jvm/args} Caused by: java.lang.ClassNotFoundException: ${surefire.jvm.args} at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at