I was trying to set my project source and target to Java 1.8 in my pom.xml and found out that it can be done both ways:
Set in properties tag:
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source>
Configure in plugin:
<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </pluginManagement>
Given a choice I would prefer option #1 since it's shorter but what really is the difference between the two?