Maven clean package lead to random "Application failed to start" - maven

I encounter a very strange issue with my jhipster application (Spring Boot + Angular, v5.0.2).
Randomly, maven compilation (./mvnw -Pprod clean package -DskipTests) give me a war that cannot be executed : I can compile and launch the war and all work fine, and one minute later, without any change, I can compile but when I launch the war I get this stack trace :
11:46:32.286 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.<init>(Lorg/yaml/snakeyaml/constructor/BaseConstructor;Lorg/yaml/snakeyaml/representer/Representer;Lorg/yaml/snakeyaml/DumperOptions;Lorg/yaml/snakeyaml/LoaderOptions;Lorg/yaml/snakeyaml/resolver/Resolver;)V
This behaviour is seen on my laptop, my collegue laptop, and a Jenkins Docker image, so does not seem to be an environment issue.
** EDIT : **
Here is the pom : http://jsfiddle.net/ewn6qLzd/ (sorry I did not found something more appropriate to share it)
Any help would be much appreciated.
Best Regards,

Related

Quarkus native image build with infinispan-client and grpc

I am trying to build a native image for an application using quarkus-infinispan-client and quarkus-grpc w/o GraalVM installed with :
mvnw package -Pnative -Dquarkus.native.container-build=true -DskipTests
The build fails with : com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building with some netty classes.
I have tried with Quarkus 1.6, 1.7 and 1.8 with a minimal application having only the two dependencies added with the same result.
Can it be a bug or I am doing something wrong ? Is there any workaround ?
Also I get a lot of warnings with Dependencies with duplicate files detected
mainly in wildfly classes.
To reproduce the problem only the dependencies need to be defined in the pom
there is no need to use any of them.

Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.18:redeploy (default-cli) on project

I am running and deploying on Windows. The app server is Tomcat 8. Not clear what this error means or how to resolve it.
Any help is greatly appreciated.
your question is similar my problem, I solved it. perhaps you have not properly started your server before using maven. for more details take a look at Deploying the JavaEE 8 Tutorial, by maven gets Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy (deploy) on project hello1

Eclispe/STS terminates the maven program without output in console

I am using Eclipse/STS with Maven and also pointing eclipse/sts maven path to local direcotry for my artifacts repository. However, when I run or debug the maven project, it gets terminate without any output on console, also other team member are using same setup of maven in eclipse/sts but they do not face any such problem. When I run the project from command prompt it run fine without any problem.
Is there any solution for this, I have tried in eclipse and STS and facing same problem. I would appreciate your inputs.
I was using maven which is not compatible with STS/Eclipse due to which it was terminating the program immidiatly after running!!!

How to run spring web app (jdk 8) with embedded Tomcat 8

We have a Spring web app (JDK 1.8) and (for development purposes) we're running it on embedded tomcat container, i.e. - we're using tomcat7-maven-plugin. The app is being started with
mvn tomcat7:run ...
For what I found out on I-net, there is no tomcat8-maven-plugin yet.
I found a few posts that claim that this also works with Tomcat 8, but it's not clear how to configure maven plugin to run Tomcat version 8, instead of version 7.
I tried this:
https://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/adjust-embedded-tomcat-version.html
and the build was successful, but the run failed with:
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:
run (default-cli) on project spotbuy: Execution default-cli of goal org.apache.t
omcat.maven:tomcat7-maven-plugin:2.2:run failed: An API incompatibility was encountered while executing org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run: java.lang.NoSuchMethodError: org.apache.catalina.startup.Tomcat.setDefaultRealm(Lorg/apache/catalina/Realm;)
I researched again and I found out, this is known unresolved problem.
Provided it's even possible, can anybody, please, give more details what and where should be configured?
It's not possible ... for now ...

How to have Buildship recognize existing projects in Eclipse Mars

I just converted my Maven project to a gradle project. It was a multi project structure:
master-project
pom.xml
---->project1
-------->pom.xml
---->project2
-------->pom.xml
---->project3
-------->pom.xml
I ran a gradle init on it and have this structure now:
master-project
build.gradle
---->project1
-------->build.gradle
---->project2
-------->build.gradle
---->project3
-------->build.gradle
Everything builds fine, and I have been able to get some things done with that I couldn't figure out how to do with Maven, so that's great. Next step was to integrate that into the IDE since the Maven Dependencies are gone since I have removed the pom.xml files.
However the project isn't recognized as a gradle project - and I am not sure how to change that?
In Eclipse Mars it's still recognized as a Maven build, not gradle....
Thanks in advance.
EDIT: I reimported the projects which enabled the plugin for Eclipse. Now I am having weird behavior.
The build works from the command line, however when attempting the same execution from within Eclipse, it fails trying to copy the file dependencies.
For example:
Couldn't copy dependency jakarta-regexp-1.4.jar
java.nio.file.NoSuchFileException: C:\Users\user.m2\repository\jakarta-regexp\jakarta-regexp\1.4\jakarta-regexp-1.4.jar -> build\jfx\app\lib\jakarta-regexp-1.4.jar
I haven't changed the repo from maven yet - just changed the build scripts. This is running from the master project. So I am confused as to why the script would work from the commandline but not from within eclipse.
EDIT 2: Turns out this behavior is also present when running from the command line when the --daemon flag is set. Is there anyway to run the tasks without the daemon in Buildship? Or perhaps a way to fix this issue when the --daemon flag is enabled?
Thanks.
The issue with the build was that there is a leak in the JDK when bundling the JRE with the native app. This only happens when running with the --daemon flag (which all IDEs user). Therefore until this is fixed you will need to run gradle --stop and then run the clean.
The plug in I am using is no longer running the native task when running with --daemon.

Resources