Maybe at the beginning that question is stupid and i get minuses but..
please tell me which one plugin code should i use ?
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
or
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<!-- put your configurations here -->
</configuration>
</plugin>
</plugins>
You should use the second one, especially if you use maven 3.
It is a good practice to explicitly specify the
groupIdso that there is no confusion. Some plugins are available fromorg.codehaus.mojo, for instance. Maven does resolve the plugin as documented here.versionis relevant if you are using maven3, as described here.You would still specify the source/target versions in either case, if you want it to be different from the jdk you are using.