The source and target versions can be set separately for the compile and testCompile goals of the maven compiler plugin. You can change the settings either by defining properties in your pom:
1.41.41.51.5
Or by explicit configuration of the compiler plugin: