Use “enforce byte code version” rule: http://www.mojohaus.org/extra-enforcer-rules/enforceBytecodeVersion.html. You can set ignoreScopes to test.
Anyone know how to validate newer jdk methods are not used? Chas > On May 16, 2018, at 7:08 AM, Graham Leggett <[email protected]> wrote: > >> On 15 May 2018, at 11:08 PM, Hervé BOUTEMY <[email protected]> wrote: >> >> I'm maintaining Doxia and maven-site-plugin for a long time, trying to keep >> the prerequisites (for end users particularly) as low as possible when I >> don't >> have a strong win on upgrading. > > +1 - my feeling too. > >> Currently, maven-site-plugin (which is what users see, without knowing much >> about Doxia) requires Java 6 only. >> With Doxia 1.8 / maven-site-plugin 3.7, in fact, there is a little trick: >> one >> Doxia module (Markdown) requires Java 7, because of the library used, and I >> documented how one can downgrade this module if he strictly require to use >> maven-site-plugin 3.7 with Java 6. >> But for sure, when building maven-site-plugin, I didn't try to add a profile >> to be able to build with Java 6: Java 7 is required to build maven-site- >> plugin. >> >> Honestly, for Java 6, maven-site-plugin 3.7 is the last version: now it's >> time >> to drop it and require Java 7 if you want newer version of the plugin. >> >> Then I'm full ok to upgrade Doxia requirement for Doxia 1.9 and maven-site- >> plugin 3.8 to Java 7. >> >> >> On httpunit, AFAIK it's only for Doxia tests during its build: I don't have >> any issue with building Doxia with Java 8 to produce jar that require Java 7 >> only. > > How I tripped over this was the enforcer plugin - enforcer found Java 8 code > being brought in by httpunit and said “no”. > > Not knowing a lot about the enforcer plugin, is there a way to build the > primary artifacts at compliance level v1.6, but build and run the tests at > v1.8? > > Regards, > Graham > — >
