Maven issue while Building for a latest fix given by WSO2 - maven

WSO2 has given a latest fix for Governance Registry5.3.0(Governance REST API Update issue). While building a code for applying a fix the below error is thrown.
Error when building code using Maven.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project org.wso2.carbon.governance.api: Compilation failure: Compilation failure:
[ERROR] \Users\a596500\Downloads\carbon-governance-master\components\governance\org.wso2.carbon.governance.api\src\main\java\org\wso2\carbon\governance\api\util\CheckpointTimeUtils.java:[22,30] error: package org.apache.commons.lang does not exist
[ERROR] Failed to execute goal on project org.wso2.carbon.governance.api: Could not resolve dependencies for projectorg.wso2.carbon.governance:org.wso2.carbon.governance.api:bundle:4.7.2-SNAPSHOT: The following artifacts could not beresolved: org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.common:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.admin.api:jar:4.6.1-SNAPSHOT
org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:jar:4.6.1-SNAPSHOT: Could not find artifact org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT in nexuspro-level0 (https://repo.fmr.com/content/groups/level0/)

Please clone below repos, Move to the relevant tag and run an mvn clean install -e on each and every repo accordingly.
https://github.com/wso2/carbon4-kernel.git tag : 4.4.7
https://github.com/wso2/carbon-registry.git tag : 4.6.0
https://github.com/wso2/carbon-governance.git tag : 4.7.1
https://github.com/wso2/carbon-governance-extensions.git tag : 4.5.2
https://github.com/wso2/jaggery-extensions.git tag : 1.5.5
https://github.com/wso2/carbon-store tag : 2.4.6
https://github.com/wso2/product-greg.git tag : 5.3.0
To apply the fix and generate the latest jar you have to apply the fix manually to 5.3.0 tag from your local machine and build the source.

Related

Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)

While following the instructions to setup IntelliJ for pulsar development I got the below error
Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)
Digging deeper into the snapshots, I don't see pulsar-broker at 2.12.0 either: https://repository.apache.org/content/groups/snapshots/org/apache/pulsar/pulsar-broker/
Is there some configuration step missing?
Attempted Fix [RESOLVED]
accepted answers steps and fix an issue with SDKMAN to have mvn call Java 17
I tried the command mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true and got the new error below.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildtools: Compilation failure
[ERROR] /Users/brandon.hoffman/Projects/pulsar/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java:[30,18] cannot access org.testng.ITestResult
[ERROR] bad class file: /Users/brandon.hoffman/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar(org/testng/ITestResult.class)
[ERROR] class file has wrong version 55.0, should be 52.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
Running this on the command line will fix that problem:
mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true
You must use Java 17 for compiling the master branch version of Pulsar (requirements).
It's possible that there has been some change in the maven build after the instructions were originally written.
It does not look like the project is currently using the repository.apache.org for nightly snapshots. You should ask your question on the dev#pulsar.apache.org mailing list.
Also we have not yet cut the 2.12 branch. The VOTE for the first release of 2.11.0 just passed the PMC.
(FYI I am an Apache Pulsar PMC Member)

Trying to analyze Gson project with sonarQube "Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:6.2.0:bnd-process (default) on project gson"

I have downloaded a .zip of the official Gson project repo from github.
I have docker installed And I'm trying to analyze Gson with SonarQube.
I have chose the local project option and created a new token and chose maven to analyze:
when I run this command:
mvn clean verify sonar:sonar -Dsonar.projectKey=GSON-res -Dsonar.host.url=http://localhost:9000 -Dsonar.login=token_code
I get this error:
[ERROR] Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:6.2.0:bnd-process (default) on project gson: Classes found in the wrong directory: {com/google/gson/package-info.class=com\google\gson\package-info, com/google/gson/internal/package-info.class=com\google\gson\internal\package-info, com/google/gson/reflect/package-info.class=com\google\gson\reflect\package-info, com/google/gson/stream/package-info.class=com\google\gson\stream\package-info, com/google/gson/annotations/package-info.class=com\google\gson\annotations\package-info} -> [Help 1]
This appears to be unrelated to SonarQube and is caused by a bug in the Maven Compiler Plugin version used by Gson: MCOMPILER-485
The Maven Compiler Plugin dependency of Gson has been updated to the fixed version 3.10.1, so this issue should be solved once you pull the latest Gson source code again.

sonar maven plugin fails to import project

I'm trying to import my project on a remote server via maven plugin but a got the following error:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar
(default-cli) on project prj: Error 405 on
https://sonarqubevc.scalefocus.com/api/ce/submit?projectKey=bg.prj.commerce:prj&projectName=prj%20Application :
{"errors":[{"msg":"HTTP method POST is required"}]}
The version of the server is - SonarQube version: 6.3.0
Any ideas? Is it a bug that I hit or there is some misconfiguration on my side?
Thx

Unable to get dependency information when running mvn jetty:run

I cloned a project from github and try to build it. Follow its instruction I run mvn package but when I try to run mvn jetty:run. It failed and give me:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Unable to get dependency information: Unable to read the metadata file for artifact 'org.mortbay.jasper:apache-jsp:jar': Cannot find parent: org.eclipse.jetty:jetty-parent for project: org.mortbay.jasper:jasper-jsp:pom:8.0.9.M3 for project org.mortbay.jasper:jasper-jsp:pom:8.0.9.M3
org.mortbay.jasper:apache-jsp:jar:8.0.9.M3
Why this happen?
Upgrade maven to version 3 or higher. I had maven 2.2.1, then I upgraded it to 3.3.9 and this issue was solved.
Also use JDK 1.7 or higher.

sonar-maven-plugin 5.1.1 not found

I've just installed the latest version of SonarQube (5.1.1) and when I try to run the sonar:sonar target, I get an error:
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.codehaus.sonar:sonar-maven-plugin:pom:5.1.1
I've checked here:
http://mvnrepository.com/artifact/org.codehaus.sonar/sonar-maven-plugin
And it seems that version 5.1.1 of the sonar-maven-plugin has not been pushed to the public repo(s).
Is that so or am I looking in the wrong location?
The sonar-maven-plugin is an independent project that does not follow SonarQube versioning.
Correct command-line is mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
The groupId mvn.codehaus.sonar is for internal use.

Resources