Category: Maven
-
Maven error with Java 6 on OS X: “Unsupported major.minor version 51.0”
If you encounter the error below with Java 6 on OS X, make sure you’re using Maven 3.2.5 or older. $ mvn Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)…
-
Maven error in OS X: “Maven already installed, it’s just not linked”
If you use Homebrew on OS X and you come across the error below, just: $ rm -rf /usr/local/Cellar/maven $ brew install maven $ mvn -version That’s it! $ brew install maven Updating Homebrew… ==> Auto-updated Homebrew! Updated 2 taps (caskroom/cask, caskroom/versions). Warning: maven-3.5.0 already installed, it’s just not linked.
-
Maven build error: “Caused by: java.io.IOException: Incompatible version 1007”
I was encountering this error in Jenkins when it tried to build a project I was working on: Caused by: java.io.IOException: Incompatible version 1007. at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127) at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107) at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87) at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:134) at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:107) The problem was due to a breakage/bug in the jacoco-maven-plugin. To fix, simply add a version in your pom.xml, like so:…
-
Maven Error: “Bare Repository has neither a working tree, nor an index”
I suddenly couldn’t build a Maven project at work because of the error below…. Did some googling but didn’t really find helpful info, other than that I was touching a “bare” repository. I thought about it for a second and realized that maybe my changing the artifact version in the pom had something to do with it…
-
Maven: How to only execute certain Cucumber tags
I needed Maven to only run certain tests that had a specific tag (i.e., @regression). I couldn’t easily find information via the Cucumber website, so I’m logging it her for archiving. Note: This command also works in Jenkins via the “Goals and options” section. clean install -Dcucumber.options=”–tags @regression”