简体   繁体   中英

Maven current project compiled with java 1.6 which has 2 dependencies on java 1.7 and 1.6

My current Maven project is compiled with 1.6

               <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>UTF-8</encoding>
                </configuration>

However, it has 2 dependencies - say dep1.7 one of which is compiled with 1.7 and the other one, say dep1.6 is compiled with 1.6. Both dependencies cannot change their versions, ie 1.7 dependency cannot be compiled with 1.6 and vice versa. Is there a way out of this one? I can upgrade my application to compile with java 1.7. Right now, my unit tests which use the dep1.7 fails with a Unsupported major.minor version 51.0 as expected.

如何用Java 7编译dep1.6。应该可行,因为它应该是前向兼容的,除非我遗漏了一些东西。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM