You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The maven core library is called maven-core-3.x.jar. Our detection mechanism in Groovy script expects it to have full version.
The detection mechanism fails and reports the version is not good enough:
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project standalone-pom: Requires Maven >= 3.2.5 -> [Help 1]
We should change our version detection mechanism to work for such scenarios (or accept "unknown" maven versions instead of failing).
The text was updated successfully, but these errors were encountered:
I'm not sure where the groovy script lives and I'm a bit of a groovy novice, but perhaps something like this could be used to reach inside the .jar and pull the value directly from the manifest instead of relying on the filename?
(Note, Crude adaption of the code you pasted in Slack)
def mavenCoreJar = mavenLibDir.list().find { it.startsWith("maven-core-") }
if (mavenCoreJar == null) {
throw new IllegalStateException("Unable to determine Maven version")
}
String mavenVersion = new java.util.jar.JarFile(mavenCoreJar).manifest.mainAttributes.getValue("Implementation-Version");
ComparableVersion minMavenVersion = new ComparableVersion("3.2.5")
if (new ComparableVersion(mavenVersion) < minMavenVersion) {
throw new IllegalStateException("Requires Maven >= 3.2.5")
}
barchetta
changed the title
Archetype fails on maven version detection
Archetype fails on maven version detection on some Linux distributions
Jun 26, 2020
Environment Details
The maven core library is called
maven-core-3.x.jar
. Our detection mechanism in Groovy script expects it to have full version.The detection mechanism fails and reports the version is not good enough:
We should change our version detection mechanism to work for such scenarios (or accept "unknown" maven versions instead of failing).
The text was updated successfully, but these errors were encountered: