GPG key skipped during maven release - maven-gpg-plugin

I am following all the instructions listed here to release my project to sonatype repo: https://dzone.com/articles/publish-your-artifacts-to-maven-central
But still getting the following error during signing artifacts
[INFO] --- maven-gpg-plugin:3.0.1:sign (sign-artifacts) # exceptionless-client ---
gpg: skipped "0x9d0e3e1d": No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.750 s
[INFO] Finished at: 2021-08-03T10:52:18+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign (sign-artifacts) on project exceptionless-client: Exit code: 2 -> [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 rezad the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I can see the key listed when I run gpg --list-key command.

I used git bash to generate new keys, but I didn't know that git bash also comes with a bundled gpg program and it was using that. However, the maven-gpg-plugin was trying to find keys using the gpg program installed under C:/Program Files(x86). After I created keys using this I installed it worked perfectly.

Related

AWS Elasticbeanstalk command not applicable app_deploy [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I have an AWS ElasticBeanstalk with an autoscaler with minimum 2 instancens with rolling update/deploy.
Everytime I change a configuration or do a deploy 1 instance becomes degraded because the app deploy did not work.
In the events section I always get that everything worked successfully.
If I pull the logs I always have the error Ignoring not applicable command.
The only way to solve this is to rebuild the entire environment. But that is not a solution when it will be in use.
Does anyone know what the problem could be here?
Here is a bit more of the log:
2020/11/09 09:07:26.391864 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf eb-app.target | cut -d= -f2
2020/11/09 09:07:26.396798 [INFO]
2020/11/09 09:07:26.396946 [INFO] Executing instruction: RunAppDeployPostDeployHooks
2020/11/09 09:07:26.396958 [INFO] The dir .platform/hooks/postdeploy/ does not exist in the application. Skipping this step...
2020/11/09 09:07:26.396963 [INFO] Executing cleanup logic
2020/11/09 09:07:26.397053 [INFO] CommandService Response: {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"Engine execution has succeeded.","returncode":0,"events":[{"msg":"Instance deployment: You didn't include a 'composer.json' file in your source bundle. The deployment didn't install Composer dependencies.","timestamp":1604912843,"severity":"INFO"},{"msg":"Instance deployment completed successfully.","timestamp":1604912846,"severity":"INFO"}]}]}
2020/11/09 09:07:26.397207 [INFO] Platform Engine finished execution on command: app-deploy
2020/11/09 09:07:30.733429 [INFO] Starting...
2020/11/09 09:07:30.733481 [INFO] Starting EBPlatform-PlatformEngine
2020/11/09 09:07:30.733496 [INFO] reading event message file
2020/11/09 09:07:30.733631 [INFO] no eb envtier info file found, skip loading env tier info.
2020/11/09 09:07:30.733698 [INFO] Engine received EB command cfn-hup-exec
2020/11/09 09:07:30.803414 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-2:071446605374:stack/awseb-e-8xpbfxci3w-stack/9b3236e0-2266-11eb-848a-02d86b75fc8e -r AWSEBAutoScalingGroup --region eu-west-2
2020/11/09 09:07:31.154319 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-2:071446605374:stack/awseb-e-8xpbfxci3w-stack/9b3236e0-2266-11eb-848a-02d86b75fc8e -r AWSEBBeanstalkMetadata --region eu-west-2
2020/11/09 09:07:31.504159 [INFO] checking whether command app-deploy is applicable to this instance...
2020/11/09 09:07:31.504173 [INFO] this command is not applicable to the instance, thus instance shouldn't execute command
2020/11/09 09:07:31.504177 [INFO] skip command app-deploy for this instance...
2020/11/09 09:07:31.504184 [ERROR] Ignoring not applicable command.
2020/11/09 09:07:31.504188 [INFO] Executing cleanup logic
2020/11/09 09:07:31.504237 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Ignoring not applicable command.","returncode":0,"events":[]}]}
2020/11/09 09:07:31.504389 [INFO] Platform Engine finished execution on command: app-deploy
I got the same error message when I added a new entry into container_commands and tried to deploy.
I solved this by setting minimum instances in Capacity configuration to 2 (previously 1). After the new instance was spun, deployment run without problems.

Oozie 4.3.0 build failed on Hadoop 2.9.0

I ran the build with commands like this:
./mkdistro.sh -DskipTests
and this:
./mkdistro.sh -DskipTests -D hadoop.version=2.3.0 -P uber -P hadoop-2
But all failed with error messages:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /root/oozie-4.3.0/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java:[31,49] error: cannot find symbol
[ERROR] package org.apache.hadoop.yarn.api.protocolrecords
/root/oozie-4.3.0/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java:[70,21] error: cannot find symbol
[ERROR] class LauncherMainHadoopUtils
/root/oozie-4.3.0/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java:[71,11] error: cannot find symbol
[INFO] 3 errors
...
I also tried to export HADOOP_CLASSPATH and CLASSPATH variables to point to the Hadoop libraries but all failed with same error. I am not sure if it is failed because the build command can't find hadoop libraries or it does not support Hadoop version 2.9.0.
Any idea?
watch it my newly created blog to install oozie-4.3.0 on combination of hadoop-2.9.0 step by step,
Installing apache oozie-4.3.0 on existing apache hadoop-2.9.0
hope this will help you.

Jenkins error: Authorization failed to svn in sonarqube.

I am using Jenkins 2.8 with Sonarqube Plugin 2.2.1. A week ago we had a problem with the sonar server and we get this error. To solve the problem we decided to create a new mysql schema and link it with sonar server.
We did something like this:
mysql –u root -plinux;
create database sonarqube2 character set utf8;
grant all privileges on sonarqube2.* to 'sonarsuer'#'localhost' identified by 'linux';
grant all privileges sonarqube2.* to 'sonaruser'#'%' identified by 'linux';
flush privileges;
Note: We used the same user we had in the old database
After update sonar.jdbc.url with the new data in sonar.properties and in Jenkins configuration we manage to deploy sonarqube again. Then, we tried to launch a SONAR job that we have already created before and we get this error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project cas: The svn blame command [svn blame --xml --non-interactive -x -w src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java] failed: svn: OPTIONS of 'https://my_svn_server/svn/mycompanyxf/cas/trunk/src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java': authorization failed: Could not authenticate to server: rejected Basic challenge (https://my_svn_server) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project cas: The svn blame command [svn blame --xml --non-interactive -x -w src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java] failed: svn: OPTIONS of 'https://my_svn_server/svn/mycompanyxf/cas/trunk/src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java': authorization failed: Could not authenticate to server: rejected Basic challenge (https://my_svn_server)
This is the whole stacktrace:
[INFO] --- sonar-maven-plugin:2.6:sonar (default-cli) # cas ---
[INFO] SonarQube version: 5.0.1
[WARNING] Invalid POM for org.samba.jcifs:jcifs-ext:jar:0.9.4, transitive dependencies (if any) will not be available, enable debug logging for more details
INFO: Default locale: "es_ES", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /u01/jenkins_home/jobs/SONAR - MC - Cas/workspace/trunk/target/sonar
INFO: SonarQube Server 5.0.1
[INFO] [13:47:05.297] Load global referentials...
[INFO] [13:47:05.751] Load global referentials done: 458 ms
[INFO] [13:47:05.771] User cache: /home/tomcat/.sonar/cache
[INFO] [13:47:05.801] Install plugins
[INFO] [13:47:07.792] Install JDBC driver
[INFO] [13:47:07.802] Create JDBC datasource for jdbc:mysql://myserver:3306/sonarqube2?useUnicode=true&characterEncoding=utf8
[INFO] [13:47:11.353] Initializing Hibernate
[ERROR] [13:47:15.591] No license for plugin views
[INFO] [13:47:16.958] Load project referentials...
[INFO] [13:47:18.003] Load project referentials done: 1045 ms
[INFO] [13:47:18.003] Load project settings
[INFO] [13:47:19.038] Loading technical debt model...
[INFO] [13:47:19.097] Loading technical debt model done: 59 ms
[INFO] [13:47:19.115] Apply project exclusions
[INFO] [13:47:19.336] ------------- Scan CAS (Central Authentication Service)
[INFO] [13:47:19.339] Load module settings
[INFO] [13:47:21.334] Loading rules...
[INFO] [13:47:23.049] Loading rules done: 1715 ms
[INFO] [13:47:23.115] Configure Maven plugins
[INFO] [13:47:23.367] No quality gate is configured.
[INFO] [13:47:29.435] Initializer FindbugsMavenInitializer...
[INFO] [13:47:29.437] Initializer FindbugsMavenInitializer done: 2 ms
[INFO] [13:47:29.437] Base dir: /u01/jenkins_home/jobs/SONAR - MC - Cas/workspace/trunk
[INFO] [13:47:29.437] Working dir: /u01/jenkins_home/jobs/SONAR - MC - Cas/workspace/trunk/target/sonar
[INFO] [13:47:29.438] Source paths: src/main/webapp, pom.xml, src/main/java
[INFO] [13:47:29.438] Test paths: src/test/java
[INFO] [13:47:29.439] Binary dirs: target/classes
[INFO] [13:47:29.439] Source encoding: UTF-8, default locale: es_ES
[INFO] [13:47:29.439] Index files
[INFO] [13:47:30.480] 36 files indexed
[INFO] [13:47:31.213] Quality profile for java: Sonar way
[INFO] [13:47:31.213] Quality profile for js: Sonar way
[INFO] [13:47:31.300] JIRA issues sensor will not run as some parameters are missing.
[INFO] [13:47:31.392] Sensor JavaSquidSensor...
[INFO] [13:47:32.089] Java Main Files AST scan...
[INFO] [13:47:32.094] 25 source files to be analyzed
[INFO] [13:47:36.733] Java Main Files AST scan done: 4643 ms
[INFO] [13:47:36.733] 25/25 source files analyzed
[INFO] [13:47:36.746] Java bytecode scan...
[INFO] [13:47:37.302] Java bytecode scan done: 556 ms
[INFO] [13:47:37.305] Java Test Files AST scan...
[INFO] [13:47:37.306] 5 source files to be analyzed
[INFO] [13:47:37.626] 5/5 source files analyzed
[INFO] [13:47:37.627] Java Test Files AST scan done: 321 ms
[INFO] [13:47:37.633] Package design analysis...
[INFO] [13:47:37.684] Package design analysis done: 51 ms
[INFO] [13:47:37.801] Sensor JavaSquidSensor done: 6409 ms
[INFO] [13:47:37.813] Sensor QProfileSensor...
[INFO] [13:47:37.819] Sensor QProfileSensor done: 6 ms
[INFO] [13:47:37.819] Sensor Maven dependencies...
[INFO] [13:47:40.023] Sensor Maven dependencies done: 2204 ms
[INFO] [13:47:40.026] Sensor JavaScriptSquidSensor...
[INFO] [13:47:40.205] 6 source files to be analyzed
[INFO] [13:47:45.590] 6/6 source files analyzed
[INFO] [13:47:48.499] Sensor JavaScriptSquidSensor done: 8473 ms
[INFO] [13:47:48.506] Sensor CoverageSensor...
[INFO] [13:47:48.507] Sensor CoverageSensor done: 1 ms
[INFO] [13:47:48.507] Sensor InitialOpenIssuesSensor...
[INFO] [13:47:48.525] Sensor InitialOpenIssuesSensor done: 18 ms
[INFO] [13:47:48.525] Sensor ProjectLinksSensor...
[INFO] [13:47:48.557] Sensor ProjectLinksSensor done: 32 ms
[INFO] [13:47:48.558] Sensor VersionEventsSensor...
[INFO] [13:47:48.600] Sensor VersionEventsSensor done: 42 ms
[INFO] [13:47:48.600] Sensor FileHashSensor...
[INFO] [13:47:48.608] Sensor FileHashSensor done: 8 ms
[INFO] [13:47:48.610] Sensor CoberturaSensor...
[INFO] [13:47:48.616] parsing /u01/jenkins_home/jobs/SONAR - MC - Cas/workspace/trunk/target/site/cobertura/coverage.xml
[INFO] [13:47:49.078] Sensor CoberturaSensor done: 468 ms
[INFO] [13:47:49.078] Sensor SCM Sensor...
[INFO] [13:47:49.089] SCM provider for this project is: svn
[INFO] [13:47:49.089] Retrieve SCM blame information...
[INFO] [13:47:49.218] 36 files to be analyzed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.240s
[INFO] Finished at: Fri Aug 12 13:47:54 CEST 2016
[INFO] Final Memory: 58M/955M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project cas: The svn blame command [svn blame --xml --non-interactive -x -w src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java] failed: svn: OPTIONS of 'https://my_svn_server/svn/mycompanyxf/cas/trunk/src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java': authorization failed: Could not authenticate to server: rejected Basic challenge (https://my_svn_server) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project cas: The svn blame command [svn blame --xml --non-interactive -x -w src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java] failed: svn: OPTIONS of 'https://my_svn_server/svn/mycompanyxf/cas/trunk/src/main/java/net/mycompany/cas/CookieRetrievingCookieGeneratorPatch.java': authorization failed: Could not authenticate to server: rejected Basic challenge (https://my_svn_server)
Should I change aditional credential in Jenkins?
Any help would be appreciated.
See SonarQube 5.0 SCM support documentation for details on how to configure SVN authentication (which is what is failing here) using sonar.svn.username and sonar.svn.password.secured.
(side-note: SonarQube 5.0 is pretty old and known for having performance issues, you should really upgrade to latest/LTS version)

web.xml not found during maven build of Tomcat application

I am receiving the following error when pushing a J2EE app to my OpenShift Tomcat application:
remote: [INFO] Webapp assembled in [40 msecs]
remote: [INFO] Building war: /var/lib/openshift/54eb9daa5973ca7b9a0000d9/app- root/runtime/repo/webapps/ROOT.war
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD FAILURE
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time: 4.339s
remote: [INFO] Finished at: Wed Feb 25 14:51:14 EST 2015
remote: [INFO] Final Memory: 8M/112M
remote: [INFO] ------------------------------------------------------------------------
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project dragonfly: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I have my web.xml in webapp/WEB-INF/web.xml and in .openshift/config/web.xml
I'm also confused about webapp vs. WebContent.
The web.xml file must be placed under src/main/webapp/WEB-INF. The error you are getting is because Maven is not finding web.xml at this location.
Also, I will take a wild guess but I presume WebContent is the folder generated by Eclipse when you create a web-application. If this folder is present, then there is a issue with your Eclipse project configuration. You should follow Maven conventions through out your project (and add the Maven nature to your Eclipse project with the m2e plugin).

Jenkins-Sonar communication on Openshift

I am making a development environnement based on Jenkins and Sonar.
Both are placed on isolated gears.
The Jenkins gear has been created with the Instant App option.
The Sonar gear has been created thanks to these github indications.
I created a Jenkins free-style job in order to analysis a Maven project.
The script used on that job is based on this wordpress article.
# Build script of the Job
settingsPath=$OPENSHIFT_DATA_DIR/settings.xml
settings="<settings>\n <localRepository>$OPENSHIFT_DATA_DIR</localRepository>\n</settings>\n"
echo $settings > $settingsPath
# Cleaning of the workspace
mvn --global-settings $settingsPath clean test
# Preparation of Sonar informations
export SONAR_JDBC="-Dsonar.jdbc.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/sonar?useUnicode=true&characterEncoding=utf8"
export SONAR_DRIVER=-Dsonar.jdbc.driver=com.mysql.jdbc.Driver
export SONAR_DBUSER=-Dsonar.jdbc.username=xxx
export SONAR_DBPASS=-Dsonar.jdbc.password=xxx
export SONAR_URL=-Dsonar.host.url=http://sonar-alc.rhcloud.com
export SONAR_OPTS="$SONAR_JDBC $SONAR_DRIVER $SONAR_DBUSER $SONAR_DBPASS $SONAR_URL"
# Sonar analysis
mvn --global-settings $settingsPath sonar:sonar $SONAR_OPTS
On the execution of the mvn sonar:sonar command, I have the following error:
Can not execute SonarQube analysis: Fail to connect to database: Cannot create PoolableConnectionFactory (Communications link failure
Here is the stacktrace corresponding to this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ClientEvalcolor 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.1:sonar (default-cli) # ClientEvalcolor ---
[INFO] SonarQube version: 3.3.1
[INFO] [03:28:09.324] Create JDBC datasource for jdbc:mysql://xxx.xxx.xxx.xxx:3306/sonar?useUnicode=true&characterEncoding=utf8
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.634s
[INFO] Finished at: Mon Nov 25 03:28:10 EST 2013
[INFO] Final Memory: 12M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project ClientEvalcolor: Can not execute SonarQube analysis: Fail to connect to database: Cannot create PoolableConnectionFactory (Communications link failure
[ERROR]
[ERROR] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.): No route to host
[ERROR] -> [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
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I know that an Openshift mysql database isn't accessible from a remote server, but Sonar seems to be runnable on Openshift, and the article that I previously linked successfully did it.
Do you have any idea about how to fix that ?
Thank you,
Alvaro C.
I finally succeeded on making my Jenkins gear send data to my Sonar gear !
I'll explain the solution I found here, maybe it will help some people.
There a three ways to access an Openshift database:
The gear that contains that database can access it easily on localhost:3306. That's the usual case.
From your own computer, you can bind ports (with the rhc tool) in order to access the database. This can't be applied from another gear, and requires the rhc tool to keep running.
Any gear from your account can access the database of a scalable application.
Usage:
When creating the Sonar gear, it's necessary to set the gear as scalable (this can't be done with jenkins/diy gears). Adding a database cartridge to this gear will consume 1 gear, but this database can be accessed from any Openshift application.
Notice that this new database will have a port different than 3306 (in my case, 39536). If you don't have this, that's probably that the embedded app isn't set scalable.
The Jenkins job script that I put in my question is correct. Changing all these "xxxxx" and the port with your database info will permit Jenkins to do his job !