<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jacorb</groupId>
        <artifactId>jacorb-parent</artifactId>
        <version>3.0</version>
        <relativePath>../..</relativePath>
    </parent>

    <artifactId>idl-compiler</artifactId>
    <packaging>jar</packaging>

    <name>JacORB IDL Compiler</name>
    <description>JacORB IDL Compiler</description>
    <url>http://www.jacorb.org</url>

    <properties>
        <mainArtifact>${env.JACORB_HOME}/lib/idl.jar</mainArtifact>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <!-- Normally we would just unzip the idl jar for the jar-plugin to repack. However, as the IDL -->
                    <!-- compilation is quick we'll ensure we can rebuild it here -->
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="plugin_classpath" refid="maven.plugin.classpath"/>
                                <ant antfile="${env.JACORB_HOME}/build.xml" inheritAll="true" inheritRefs="true" target="compiler">
                                    <property name="sun.boot.class.path" value="${sun.boot.class.path}:${plugin_classpath}"/>
                                    <property name="basedir" value="${env.JACORB_HOME}"/>
                                </ant>
                            </target>
                        </configuration>
                    </execution>
               </executions>
            </plugin>

            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>build-migration-maven-plugin</artifactId>
            </plugin>

            <!-- Generate javadoc. Bound into the package phase for deployment purposes -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <skip>${skipJavadoc}</skip>
                    <verbose>true</verbose>
                    <sourcepath>${env.JACORB_HOME}/src</sourcepath>
                    <subpackages>org.jacorb.idl</subpackages>
                </configuration>
            </plugin>


            <!-- Package up the sources as well -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${env.JACORB_HOME}/src</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>org/jacorb/idl/*</include>
                    </includes>
                </configuration>
            </plugin>

        </plugins>
    </build>
</project>
