mvn spring-boot:run build failure - java

When i try to run mvn spring-boot:run to launch this project that has worked for others in the past I'm met with this error after the build fails:
terminal screenshot
Would love help from someone who has encountered this before. Error reads:
failed to execute goal
org.springframework.boot:spring-boot-maven-plugin:2.3.4.RELEASE:run
(default-cli) on project resource-profile-repo: Application finished
with exit code: 1 -> [Help 1]

Thanks for the help! Turns out I didn't have the proper log in information in my .env for the Database so it was failing the build. User error

Related

When running sonarqube java dockerised app it get error sonarqube url not reachable

I am running sonarqube from docker and it's working great for local projects, but when running it manually on a dockerized app it gives
[ERROR] SonarQube server [http://my-external-server-url:9000] can not be reached.
I ran it with maven in DEBUG mode and I got that
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project MY-PROJECT: Unable to execute SonarQube: Fail to get bootstrap index from server: No route to host (Host unreachable) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project MY-PROJECT: Unable to execute SonarQube
Am I missing something here ??
P.S. It's a dockerized java project so I'm running from inside the docker, unlike other php projects

Jenkins Android Build Error: FAILURE: Build failed with an exception

I have been trying to do CI using Jenkins for my Android application. I am new to this. After following some of the tutorials, I am able to atleast set up and run the build now option. It download every pom required but while building it give below error.
============================================
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\e796469c387c11565d873216f24c3b6f\res\drawable\abc_ic_go_search_api_material.xml: error: file not found.
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\play-services-base-15.0.1.aar\7207fbd3bdb6cb696445cfc77c16e5ed\res\drawable-hdpi-v4\googleg_standard_color_18.png: error: file not found.
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\e796469c387c11565d873216f24c3b6f\res\layout\select_dialog_singlechoice_material.xml: error: file not found.
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
======================================================
Can you please let me know how to resolve it?
Do let me know if anything else is required.
Maybe the path is too long. Try this:
Jenkins --> Project --> Project Configuration --> Build
Select advanced option
Check the option box "Force GRADLE_USER_HOME to use workspace"
Build your project
I solved my problem by this way, good luck!
Try updating your android gradle plugin version to 3.2.0-alpha12 or newer. AAPT2's version included in these versions contains many fixes for path support on Windows which resulted in similar errors.
you can solve this by separating into smaller group of task
make separate invoke gradle script under build tab
clean build assembleDebug
test
connectedAndroidTest
i had similar issues, when i ran assembleDebug and test together in Jenkins as a single task
When using Jenkins with Window to build Android, I face this problem myself.
I fix by add GRADLE_USER_HOME to Environment Variable:
GRADLE_USER_HOME = C:\Users\*MyUserName*\.gradle
hope this help,

Run simple Rest Java hello world program

I am trying to run a simple Rest HelloWorld program as described in https://spring.io/guides/gs/rest-service/. I have downloaded Spring and Maven and added the MAVEN_HOME and M3_HOME environment variables. I have run the mvn -v command successfully in Windows command prompt. I browsed to the initial directory where the pom.xml is located. Then I run mvn spring-root:run but I get the following error:
No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\user.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
I have already searched for this error message on the internet but the suggestions are not solving my problem. Am I forgetting something related to any installation? Any idea or suggestion is highly appreciated.
Oh, I realized now I had same issue in the past...
To address
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.9.RELEASE:repackage (default) on project gs-rest-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.9.RELEASE:repackage failed: Unable to find main class -> [Help 1]
You have to create Application class (something annotated with #SpringBootApplication)
#SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
or skip tests mvn clean install -DskipTests.
For mvnw spring-boot:run I'm getting ConnectException right now...
Downloading https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
Exception in thread "main" java.net.ConnectException: Connection refused: connect
but it is very likely issue on my side...

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli)

I'm working on datastax cassandra java driver project using Maven. I've tried to build it successfully in local machine with maven and Eclipse.
However, when I deployed the project in Amazon AWS. Every time, I ran the exec:java -Dexec.mainClass=”com.example.cassandra.App”, which is a simple Hello World java file. However, I got an error:
[ec2-user#ip-172-31-18-93 simple-client]$ mvn exec:exec
-Dexec.mainClass=”com.example.cassandra.App”
Error:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (default-cli) on project simple-client: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec are missing or invalid -> [Help 1]
However, sometime when i went into the target/classes and run java com.example.cassandra.App, it can show hello world! successfully. But when I add new java file like SimpleClient.java and compile it and run, it shows the error above.

Jenkins build issue

I got the following error while running a Jenkins job
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project mosm-ui: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]: chmod exit code was: 127 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project mosm-ui: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]
Caused by: org.apache.maven.plugin.MojoExecutionException: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]
The size of the xmpweb-2.0.5.war file is 209MB.
JDK - 1.7.0_55 , Maven version - 3.2.1.
OS - RHEL 6.4
Appreciate your help in advance.
You might not be passing your PATH variable correctly. Look for something that looks like :PATH and make it :$PATH
see this similar issue here and stop thinking of it as a maven failure, but rather a bad call to chmod.

Categories