I have a maven-jaxb2-plugin. I create jaxb objects and reference it in other project classes. I installed the jaxb plugin and compiler plugin under the pluginManagement tag. Maven executes the compilation phase first than it generates the phase, where, as if I removed the pluginManagement tag, it works fine, the phase is generated first, and the whole jaxb object is generated, and then the compilation stage is performed. Due to the pluginManagement tag, my project does not compile. Is the pluginManagement tag used only to identify all plugins in the parent pump so that the child pom can reference these plugins? My project is not a multi-module project.
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${basedir}/src/main/resources/schema</schemaDirectory>
<generatePackage>com.common.dto</generatePackage>
<schemaIncludes>
<include>*.xsd</include>
</schemaIncludes>
<removeOldOutput>false</removeOldOutput>
<strict>false</strict>
<verbose>true</verbose>
<forceRegenerate>true</forceRegenerate>
<extension>true</extension>
</configuration>
</plugin>
</plugins>
</pluginManagement>
source