[ImageJ-devel] Maven puzzle

Tobias Pietzsch pietzsch at mpi-cbg.de
Wed Feb 11 09:58:50 CST 2015


Hi,

maybe one of the maven experts can shed some light on the following behaviour…

In my bigdataviewer-server pom.xml file (https://github.com/bigdataviewer/bigdataviewer-server/blob/84b6724ccdefbdcf787f4896a102bc39d415063a/pom.xml)
I want to set source compatibility to 1.7.
I tried to do this by specifying
	<properties>
		<scijava.jvm.version>1.7</scijava.jvm.version>
	</properties>
Strangely, this alone does not solve the problem. mvn on the command line says:
...
INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/pietzsch/workspace/BigDataViewer/bigdataviewer-server/src/main/java/bdv/server/BigDataServer.java:[248,46] multi-catch statement is not supported in -source 1.5
  (use -source 7 or higher to enable multi-catch statement)
…

I can fix it by additionally putting this snippet:
 	<build>
		<plugins>
	        <plugin>
	          <artifactId>maven-compiler-plugin</artifactId>
	          <configuration>
	            <source>1.7</source>
	            <target>1.7</target>
	          </configuration>
	        </plugin>
		</plugins>
	</build>
into the pom file.
However, shouldn’t this be already automatically done by setting scijava.jvm.version=1.7???
At least Eclipse seems to think so: I fact, the above snippet to configure maven-compiler-plugin I just copied from the “Effective POM” shown in Eclipse (for the pom without explicitly having the snippet of course…)

Does anyone have an explanation? Is this a maven bug?

all the best,
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150211/94f06f7b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150211/94f06f7b/attachment.pgp>


More information about the ImageJ-devel mailing list