Maven 3.5.4 support - quarkus

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.1.Final:dev
(default-cli) on project thm:
Detected Maven Version (3.5.4) is not supported, it must be in [3.6.2,). ->
How come Maven support for Version 3.5.4 was dropped?

Everything is explained in details in the commit: https://github.com/quarkusio/quarkus/commit/7364c5b8efaee2253d54a4fe0a712c095c9defb6 .
We were affected by a resolver bug for some of our dependencies and using a more recent Maven was the way to fix it, thus why we enforce it.

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.

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2(netbeans)

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project test1:
I suspect you use a quite recent version of java to execute your build and I suspect that the plugin version of maven-war-plugin does not support java modules.
So in order to get this work I think all you need is to update your maven-war-plugin version to a more recent one like 3.3.2.

Glowstone install: Maven peer not authenticated / could not resolve dependencies error

I was closely following the ‘Building’ instructions from the readme for Glowstone https://github.com/GlowstoneMC/Glowstone
but whenever I try ./setup.sh, it fails building with this stack trace:
Failed to execute goal on project glowstone: Could not resolve dependencies for project net.glowstone:glowstone:jar:1.10.2-SNAPSHOT: Failed to collect dependencies for [net.glowstone:glowkit:jar:1.10.2-R0.1-SNAPSHOT (compile), com.flowpowered:flow-network:jar:1.1.0-SNAPSHOT (compile), jline:jline:jar:2.11 (compile), org.projectlombok:lombok:jar:1.14.8 (provided), net.sf.trove4j:trove4j:jar:3.0.3 (compile), co.aikar:fastutil-lite:jar:1.0 (compile), org.jetbrains.kotlin:kotlin-runtime:jar:1.1-SNAPSHOT (compile), org.jetbrains.kotlin:kotlin-reflect:jar:1.1-SNAPSHOT (compile), io.netty:netty-transport-native-epoll:jar:4.1.0.CR7 (compile), junit:junit:jar:4.12 (test)]: Failed to read artifact descriptor for net.glowstone:glowkit:jar:1.10.2-R0.1-SNAPSHOT: Could not transfer artifact net.glowstone:glowkit:pom:1.10.2-R0.1-SNAPSHOT from/to glowstone-snapshots (https://repo.glowstone.net/content/repositories/snapshots/): peer not authenticated -> [Help 1]
I tried looking at the maven website for some hints on DependencyResolutionException and peer not authenticated error, but it didn't help. Anyone please help me, I've been stuck for a couple weeks with no progress.
I tried the same instructions and was able to reproduce your error exactly.
The problem seems to be with maven not being able to communicate securely with the repositories specified in the pom; see this answer.
After some fiddling, I was able to get the build.sh script (which is just running mvn package) to run successfully. The main idea is to lock down the dependency versions in the pom to non-SNAPSHOT versions, so that none of them need to be retrieved from those problematic repositories.
These steps should get you to a working build:
In the pom, change the kotlin-runtime and kotlin-reflect dependency versions from 1.1-SNAPSHOT
to 1.0.4.
Change the flow-network dependency version from 1.1.0-SNAPSHOT
to 1.0.0.
Download glowkit-1.10.2-R0.1-20160907.003121-11.jar and glowkit-1.10.2-R0.1-20160907.003121-11.pom and put them in the right place in your local repo (for me, that was ~/.m2/repository/net/glowstone/glowkit/1.10.2-R0.1-SNAPSHOT/)
Now you can change the value of the bukkit.version property in the pom from 1.10.2-R0.1-SNAPSHOT to 1.10.2-R0.1-20160907.003121-11
Similarly, download fastutil-lite-1.0.jar and fastutil-lite-1.0.pom from http://ci.emc.gs/nexus/content/repositories/aikar/co/aikar/fastutil-lite/1.0/, and place them in your local mvn repo (~/.m2/repository/co/aikar/fastutil-lite/1.0/)
NOTE that doing this much should have resolved all of the problems with downloading the dependencies, so at least something like mvn dependency:tree should run successfully.
Finally, even after resolving those dependency issues, there is a compilation problem because of the version of netty being used. Change the dependency version for netty-transport-native-epoll from 4.1.0.CR7 to 4.1.5.Final. Also you will have to add this explicit dependency on netty-all, since otherwise, flow-network will pull in an earlier version:
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.5.Final</version>
</dependency>
That should do it! After those steps, the mvn package, and so the setup.sh script, ran successfully for me.
This error is caused by an incompatibility in the SSL stack connecting to repo.glowstone.net.
Downgrading dependencies to avoid connecting to the Glowstone repository may avoid this particular problem, but creates other problems, and does not currently work on the latest Glowstone build since it requires the snapshot dependencies (see GH-467 on GitHub GlowstoneMC issue tracker) and also from discussion with Glowstone developers, and my own testing, downgrading now causes a different error: java.lang.IllegalAccessError: class lombok.javac.apt.Processor (in unnamed module #0x18c23b6))
Maven's error message peer not authenticated doesn't explicitly say so, but it is caused by repo.glowstone.net requiring the Server Name Indication (SNI) extension (needed by Cloudflare Flexible SSL), which older versions of Maven do not support. You can verify this by performing an SSLLabs scan on this server, which reports "This site works only in browsers with SNI support.", and capturing the SSL handshake in Wireshark which shows the server drops the connection after the first Client Hello, without server_name:
Wireshark capture demonstrating missing Extension: server_name
Wireshark capture demonstrating server closing connection
The fix is simple: upgrade to a version of Maven supporting SNI. In my case I had Maven 3.0.5 but updating to Maven 3.5.0 from maven.apache.org fixed the problem and I was able to build Glowstone without a hitch.
You can check the version of Maven you have with mvn -version, it should show something like this (the critical versions for Glowstone are Apache Maven 3.5.0+ and Java version: 1.8.0_131):
Glowstone $ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T12:39:06-07:00)
Maven home: /Users/admin/.m2
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8

Maven gives this project has disliked artifacts error when using Jung dependency

I have a Java project where I want to make some calls to a Jung library. I added the following lines to the pom.xml
net.sf.jung
jung-algorithms
2.0.1
However when I run "mvn package", I get the following error
[ERROR] Failed to execute goal licensing-maven-plugin:1.
7.5:check (enforce-licensing-oss) on project server-examples: This project
has 3 disliked artifacts. -> [Help 1]
Any insights as to what may be going wrong ?
You have configured the licensing-maven-plugin to complain when you introduce a dependency with certain licenses. You, or whoever wrote your pom. If you read the configuration for that plugin it will tell you what licenses it is configured to like and dislike.

Resources