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

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)

Related

How to build orekit from maven?

I am having issues building orekit. I am following this guide below:
https://www.orekit.org/site-orekit-latest/building.html
I have installed jdk and installed java (version 14.0.2) to the path as well as incorporated the necessary users paths (JAVA_HOME, M2_HOME, and MAVEN_HOME). I also installed the latest version of maven version 3.6.3). I tried running "mvn package" and it came up with a build failure:
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users####). Please verify you invoked Maven from the correct directory. -> [Help 1]
I am not very technically proficient using the command prompt. I assume I need something relating to orekit in the same directory. I have a folder labeled orekit which I got from github in the same directory but I still get the error.
Help please.

Logging error when executing Maven SonarQube plugin

I've been facing an issue with Maven SonarQube plugin (v2.6) when Maven version is recent (strictly larger than 3.1).
Here is what I run:
mvn clean verify -Psonar
mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar -Psonar
The first invocation makes sure sources are compiled and JaCoCo agent is prepared.
The interesting part comes, when the second command is run:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project merlin-schema: Error setting Log implementation. Cause: java.lang.reflect.InvocationTargetException: org/slf4j/Marker -> [Help 1]
Any fix to be published?
Replacing default Maven logging implementation is currently not supported. Ticket created: http://jira.sonarsource.com/browse/MSONAR-122

Why does "sbt assembly" fail with ResolveException for stax-api.jar?

While running sbt assembly, the command runs for some time and throws the following error on Windows 7:
[warn] Strategy 'discard' was applied to 4 files
[warn] Strategy 'first' was applied to 199 files
[info] Assembly up to date: C:\spark_\spark-1.0.2\assembly\target\scala-2.10\spark-assembly-1.0.2-hadoop1.0.4.jar
sbt.ResolveException: download failed: javax.xml.stream#stax-api;1.0-2!stax-api.jar
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:126)
Any ideas on how to solve this?
In the official documentation of Apache Spark there's the section Downloading that says:
If you’d like to build Spark from scratch, visit building Spark with Maven.
where you can find the command that worked fine for me (just two days ago on Mac OS X with Java 8):
mvn -Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -DskipTests clean package
p.s. I wish they'd sticked to sbt as the build tool for official releases, though.
running sbt clean before sbt assembly solved the above problem.

use Maven to add info from MKS to Sonar

According to to the SCM Activity plugin info from the Sonar Webiste (http://docs.codehaus.org/display/SONAR/SCM+Activity+Plugin), a connection to MKS should be possible. On the Maven site, MKS provider code also exists.
However, when I run mvn sonar:sonar in my command line, I get the error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project example-it-jacoco-maven: Can not execute Sonar: Unsupported SCM: [svn:integrity]. Check compatibility at http://docs.codehaus.org/display/SONAR/SCM+Activity+Plugin. Please check the parameter "sonar.scm.url" or the section of Maven pom. -> [Help 1]
Do I need to somehow import the provider (coded into the pom.xml ?) or is there something wrong with my code in the pom:
scm:svn:integrity|myuser#mkssvr1:7001|#/SonarScm/TestCode
Anybody have an idea how to get this to work?
Cheers,
Kristian
I believe that correct URL will look like : scm:integrity|myuser#mkssvr1:7001|#/SonarScm/TestCode

mvn sonar:sonar throws exception while doing Java AST scan

Please note :- My mvn clean install goes successful
but when i do mvn sonar:sonar it throws me
[ERROR] Squid Error occurs when analysing :/junk/test/src/main/java/API/com/API/HelloAPI.java
org.sonar.squid.api.AnalysisException: The source directory does not correspond to the package declaration com.API
at org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93) [sonar-squid-java-plugin-2.8.jar:na]
at org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75) [sonar-squid-java-plugin-2.8.jar:na]
http://sonar-dev.787459.n3.nabble.com/file/n3324837/squid-test.zip
The message is quite clear: the package declaration is wrong. It should be API.com.API if the source directory is /junk/test/src/main/java (that is the default value in Maven). An alternative is to change the source dir to src/main/java/API.
Could it be that your POM contains this line:
<sourceDirectory>.</sourceDirectory>
If so, changing it to this might help:
<sourceDirectory>src/main/java</sourceDirectory>
Maven doesn't care, but sonar does.
I had the same problem with sonar and a maven project generated by eclipse.
(Found the solution at http://www.digipedia.pl/usenet/thread/13899/13064/ )
I got the same error message after upgrading to a more recent sonar plugin (sonar-maven3-plugin:3.7.1/3.7.3/4.0 running against SonarQube Server 3.5.1) for a source file which worked with 3.6-RC3/3.6.3/3.7.0. Apparently 3.7.1 introduced the issue :-/

Resources