In Maven, note that the concept of a version that is not released and is still in development is called a snapshot. This means that the version should not be a release version, like
0.1.0, but a snapshot version, like
0.1.0-SNAPSHOT. This is important because it distinguishes clearly what is a version in development and a released version.
As such, consider using a snapshot version here. It is when the Maven project is released, with the help of the
maven-release-plugin, that the version will automatically be bumped to a release version (without SNAPSHOT) and tagged on version-control with it.
That is a nice way to configure the Maven project to use Java 8. You can also do it in an alternate way. Both the
target parameter of the
maven-compiler-plugin have a corresponding user property, which are
maven.compiler.target, so you can set them in a
This will have the same effect as the current
Note that you could not specify a version for the Compiler Plugin in this case; it is the default version coming from the Maven installation that would be used (reference here for 3.3.9). In general, it is a good idea not to rely on this default version and specify explicitly the version to use: this helps in ensuring that the build does not depend on a given Maven version; also it documents clearly the version that is used.
Be careful when using version ranges. Ideally, you want to declare dependencies on a single fixed version of a dependency: using a version range is bad practice.
The big advantage of using a fixed version is that it makes it clear what is the expected version to use for your project. What specific version of JUnit do you want your project to depend on? Each version are very different, all of them with their respective features and bugs. With a range, you are basically saying "I don't really care, pick one in major version 4". You could even end up with a SNAPSHOT version (MNG-3092). It should be up to you to pick a version; you can upgrade it later if necessary.
Also, you should use the
test scope for the JUnit dependency. It is only needed in the test classpath and is not a compile-time dependency of the main classes.