Tag: Maven

  • My Jacoco Maven Plugin POM config

    Adding it here so I can refer to it in the future. <jacoco.version>0.8.2</jacoco.version>         <min.branch.coverage>0.95</min.branch.coverage>         <min.line.coverage>0.95</min.line.coverage> <plugin>                 <groupId>org.jacoco</groupId>                 <artifactId>jacoco-maven-plugin</artifactId>                 <version>${jacoco.version}</version>                 <executions>                     <execution>                         <id>default-agent</id>                         <goals>                             <goal>prepare-agent</goal>                         </goals>                     </execution>                     <execution>                         <id>default-report</id>                         <goals>                             <goal>report</goal>                         </goals>                     </execution>                     <execution>                         <id>default-check</id>                         <goals>                             <goal>check</goal>                         </goals>                         <configuration>                             <rules>                                 <rule implementation="org.jacoco.maven.RuleConfiguration">                                     <element>BUNDLE</element>                                     <limits>                                         <limit implementation="org.jacoco.report.check.Limit">                                             <counter>BRANCH</counter>                                             <value>COVEREDRATIO</value>                                             <minimum>${min.branch.coverage}</minimum>                                         </limit>                                         <limit implementation="org.jacoco.report.check.Limit">                                             <counter>LINE</counter>                                             <value>COVEREDRATIO</value>                                             <minimum>${min.line.coverage}</minimum>                                         </limit>…

  • 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…

  • ActiveMQ error: “java.lang.RuntimeException: javax.jms.JMSException: Invalid version: 6, could not load org.apache.activemq.openwire.v6.MarshallerFactory”

    I was working on a project that needed to send JMS messages to an Apache ActiveMQ broker that was running an older version, specifically, 5.4.x. It started failing with the error below when I switched to it, but had no issues when it was connecting to another broker running 5.9.0. java.lang.RuntimeException: javax.jms.JMSException: Invalid version: 6,…