In Jenkins getting error while compiling the Maven project Build-Backend-Job. IN spring boot project - jenkins-pipeline

enter image description here
[INFO] --- maven-processor-plugin:5.0-jdk8-rc3:process (process) # movieapp-service ---
[WARNING] Error injecting: org.bsc.maven.plugin.processor.MainAnnotationProcessorMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:
Error injecting: private org.eclipse.aether.spi.log.Logger org.apache.maven.repository.internal.DefaultVersionRangeResolver.logger
while locating org.apache.maven.repository.internal.DefaultVersionRangeResolver

Related

Spring-Boot project build fails if stored on Desktop MacOS

If I am trying to run my SpringBoot project while it is stored in any folder located on Desktop on my MacBook - build fails.
If I move project to any other directory except Desktop - it builds fine.
What can be the reason?
Error message after maven clean - install:
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # my-blog-springboot-v1 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest
17:49:32.502 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither #ContextConfiguration nor #ContextHierarchy found for test class [AccountRepositoryTest]: using SpringBootContextLoader
17:49:32.508 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
17:49:32.509 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest]: AccountRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with #Configuration.
17:49:32.804 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua/shamray] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua/shamray
17:49:32.805 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua/shamray] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua/shamray
17:49:32.806 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua
17:49:32.807 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.012 s <<< FAILURE! - in ua.shamray.myblogspringbootv1.MyBlogSpringbootV1ApplicationTests
[ERROR] ua.shamray.myblogspringbootv1.MyBlogSpringbootV1ApplicationTests Time elapsed: 0.012 s <<< ERROR!
java.lang.IllegalStateException: Unable to find a #SpringBootConfiguration, you need to use #ContextConfiguration or #SpringBootTest(classes=...) with your test
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] MyBlogSpringbootV1ApplicationTests » IllegalState Unable to find a #SpringBoot...
[ERROR] AccountControllerTest » IllegalState Unable to find a #SpringBootConfiguration...
[ERROR] AccountRepositoryTest » IllegalState Unable to find a #SpringBootConfiguration...
[ERROR] AccountServiceImplUnitTest » IllegalState Unable to find a #SpringBootConfigur...
[ERROR] MyUserDetailsServiceImplUnitTest » IllegalState Unable to find a #SpringBootCo...
[ERROR] PostServiceImpUnitTest » IllegalState Unable to find a #SpringBootConfiguratio...
[ERROR] RoleServiceImplUnitTest » IllegalState Unable to find a #SpringBootConfigurati...
[INFO]
[ERROR] Tests run: 7, Failures: 0, Errors: 7, Skipped: 0
[INFO]

GCloud permission error when deploying to Google app engine flexible

I am trying to deploy my spring boot app to app engine via Jenkins using Maven. After maven has built the package, I am using "mvn install appengine: deploy" in the execute shell in the Build step. However, I get the following error when it is built,
GCLOUD: ERROR: (gcloud.app.deploy) Permissions error fetching application [apps/microservice-qa]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.
Detailed error trace:
[INFO] Detected App Engine flexible environment application.
Sep 12, 2017 7:54:14 AM com.google.cloud.tools.appengine.cloudsdk.CloudSdk logCommand
INFO: submitting command: /usr/lib/google-cloud-sdk/bin/gcloud app deploy
[INFO] GCLOUD: Services to deploy:
[INFO] GCLOUD:
[INFO] GCLOUD: descriptor: [/opt/bitnami/apps/jenkins/jenkins_home/workspace/demo-test/target/appengine-staging/app.yaml]
[INFO] GCLOUD: source: [/opt/bitnami/apps/jenkins/jenkins_home/workspace/demo-test/target/appengine-staging]
[INFO] GCLOUD: target project: [xxxx]
[INFO] GCLOUD: target service: [xxxxx]
[INFO] GCLOUD: target version: [20170912t075415]
[INFO] GCLOUD: target url: [https://xxxxx-dot-microservice-qa.appspot.com]
[INFO] GCLOUD:
[INFO] GCLOUD:
[INFO] GCLOUD: If this is your first deployment, this may take a while...
[INFO] GCLOUD: ....done.
[INFO] GCLOUD:
[INFO] GCLOUD: Beginning deployment of service [another-pub-sub-service]...
[INFO] GCLOUD: Building and pushing image for service [another-pub-sub-service]
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) You do not have permission to access project [xxxx] (or it may not exist): The caller does not have permission
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.198s
[INFO] Finished at: Tue Sep 12 07:54:27 UTC 2017
[INFO] Final Memory: 21M/51M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy (default-cli) on project demo-test1: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: Non zero exit: 1 -> [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/PluginExecutionException
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: Non zero exit: 1
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: com.google.cloud.tools.appengine.api.AppEngineException: Non zero exit: 1
at com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitListener.onExit(NonZeroExceptionExitListener.java:30)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.syncRun(DefaultProcessRunner.java:211)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.run(DefaultProcessRunner.java:137)
at com.google.cloud.tools.appengine.cloudsdk.CloudSdk.runGcloudCommand(CloudSdk.java:193)
at com.google.cloud.tools.appengine.cloudsdk.CloudSdk.runAppCommandInWorkingDirectory(CloudSdk.java:136)
at com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDeployment.deploy(CloudSdkAppEngineDeployment.java:90)
at com.google.cloud.tools.maven.DeployMojo.execute(DeployMojo.java:107)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
I have checked the permissions in the server for the key/user used to run gcloud commands, they both have full rights. However I still get the above error.
Also, is there any other plugin in Jenkins or any other tool (like jenkins to manage builds and deploy to app engine) to do the same?
Any help would be greatly appreciated. Thanks.
Since your Jenkins Server might not be configured with your project, use following commands in your jenkins job configuration:
Execute shell:
#!/bin/sh
gcloud -q auth activate-service-account --key-file=${PROJECT_KEY.JSON}
gcloud -q config set project ${PROJECT_ID}
mvn appengine:deploy
Also, for 'gcloud' to be available on Jenkins server, you would have to install plugin 'Google Deployment Manager Jenkins Plugin' in Jenkins.

War File not deploying properly with Jenkins

With the Jenkins, My Build is completed successfully and has used source code management from Git.I am using maven to build my project.But the war file is not deployed properly.
The Tomcat users.xml file has this content:
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script"/>
This is the stack trace of error :
**
[INFO] Building war: /root/.jenkins/workspace/First Maven project/target/hfcl.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.329s
[INFO] Finished at: Fri Sep 08 16:49:20 IST 2017
[INFO] Final Memory: 31M/279M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /root/.jenkins/workspace/First Maven project/pom.xml to HFCL/HFCL/0.0.1-SNAPSHOT/HFCL-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/First Maven project/target/hfcl.war to HFCL/HFCL/0.0.1-SNAPSHOT/HFCL-0.0.1-SNAPSHOT.war
channel stopped
Deploying /root/.jenkins/workspace/First Maven project/target/hfcl.war to container Tomcat 8.x Remote with context HFCL
[/root/.jenkins/workspace/First Maven project/target/hfcl.war] is not deployed. Doing a fresh deployment.
Deploying [/root/.jenkins/workspace/First Maven project/target/hfcl.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/root/.jenkins/workspace/First Maven project/target/hfcl.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:106)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:998)
at hudson.FilePath.act(FilePath.java:976)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
at hudson.model.Run.execute(Run.java:1764)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:542)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:419)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/HFCL] but context failed to start
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
... 18 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/HFCL] but context failed to start
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:998)
at hudson.FilePath.act(FilePath.java:976)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
at hudson.model.Run.execute(Run.java:1764)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:542)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:419)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
**
The configurations in Tomcat for jenkins is as follows :
Can anyone suggest what i am missing ?

WARNING] Unable to get resource 'org.codehaus.sonar:sonar-maven-plugin:pom:4.0'

I am trying to run maven build with sonar on Ubuntu 10.04 version..but am getting below error. Can someone help me here what configuration I need to make..
Error is here:-
[INFO] Sonar version: 4.0
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:4.0:sonar
Downloading: http://repo1.maven.org/maven2/org/codehaus/sonar/sonar-maven-plugin/4.0/sonar-maven-plugin-4.0.pom
[WARNING] Unable to get resource 'org.codehaus.sonar:sonar-maven-plugin:pom:4.0' from repository central (: Error transferring file: Connection timed out
Downloading: http://repo1.maven.org/maven2/org/codehaus/sonar/sonar-maven-plugin/4.0/sonar-maven-

Failed to execute goal net.kindleit:maven-gae-plugin:0.9.2:unpack due to API Incomatibility

I'm new to Spring Roo as well as Maven. I was trying to setup a basic Google App Engine web application using Spring Roo. But when I run the tests - perform tests/mvn test - I get an error saying unable to run the goal Unpack due to API incomatibility.
Details:
gae.version: 1.6.1
gae-runtime: 0.9.2
Tried the same with 1.6.0 and 0.9.0 - still gives me the same error.
Exception:
[INFO] --- maven-gae-plugin:0.9.2:unpack (default) # project_x ---
Feb 8, 2012 2:47:40 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: net.kindleit.gae.UnpackGoal
java.lang.TypeNotPresentException: Type net.kindleit.gae.UnpackGoal not present
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:109)
at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:45)
...
...
... 41 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.836s
[INFO] Finished at: Wed Feb 08 14:47:40 IST 2012
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.kindleit:maven-gae-plugin:0.9.2:unpack (default) on project project_x: Execution default of goal net.kindleit:maven-gae-plugin:0.9.2:unpack failed: Unable to load the mojo 'unpack' in the plugin 'net.kindleit:maven-gae-plugin:0.9.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Bad version number in .class file
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>net.kindleit:maven-gae-plugin:0.9.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/myself/.m2/repository/net/kindleit/maven-gae-plugin/0.9.2/maven-gae-plugin-0.9.2.jar
[ERROR] urls[1] = file:/Users/myself/.m2/repository/net/kindleit/gae-runtime/1.6.1/gae-runtime-1.6.1.pom
...
..
I tried googling this issue, but didn't come across anyone facing this issue. I guess, I'm missing some dependency in the generated POM - but due to my inexperience I'm not able to figure out the exact cause.
Let me know, if I need to upload the generated pom.xml or any other details.
meanwhile, I'll continue to figure out what is causing the issue.
Thanks in advance.
Looks like an API incompatibility:
due to an API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Bad version number in .class file

Resources