<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>ext-libs-pjba</artifactId>
    <packaging>jar</packaging>

    <parent>
        <groupId>ml.alternet</groupId>
        <artifactId>alternet-libs</artifactId>
        <version>1.0</version>
        <relativePath>../alternet-libs</relativePath>
    </parent>

    <url>http://soat.developpez.com/tutoriels/java/jvm/decouverte-machine-virtuelle-java/?page=bytecode-avec-plume-java-bytecode-assembler-pjba</url>

    <name>PJBA (external library)</name>
    <description>PJBA is a light bytecode manipulation tool, but not available in Maven.</description>

    <properties>
        <shortName>PJBA</shortName>
        <m2e.apt.activation>jdt_apt</m2e.apt.activation>
        <java.version>1.8</java.version>

        <site.deploy.dir>${project.build.directory}/staging/${shortName}</site.deploy.dir>
    </properties>

    <distributionManagement>
        <site>
            <id>${project.artifactId}-site</id>
            <url>http://alternet.ml/alternet-libs/${shortName}</url>
        </site>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <proc>none</proc>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                  <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                      <goal>add-source</goal>
                    </goals>
                    <configuration>
                      <sources>
                        <source>${project.basedir}/download/pjba/jvm_hardcore-p22/03_projects/pjba/01_src/main/java</source>
                      </sources>
                    </configuration>
                  </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>download-pjba</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>download-single</goal>
                        </goals>
                        <configuration>
                            <url>https://github.com/</url>
                            <fromFile>yohanbeschi/jvm_hardcore/archive/p22.zip</fromFile>
                            <toDir>${project.build.directory}/download/pjba</toDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>truezip-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>unzip-jpba</id>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <verbose>true</verbose>
                            <fileset>
                                <directory>${project.build.directory}/download/pjba/p22.zip</directory>
                                <outputDirectory>${project.basedir}/download/pjba</outputDirectory>
                            </fileset>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <dependencySourceExcludes>org.isk.jvmhardcore.*</dependencySourceExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.maven-jar-plugin}</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>${project.basedir}/download/pjba/jvm_hardcore-p22/03_projects/pjba/01_src/main/java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>ml/alternet/**</include>
                            </includes>
                            <!-- >excludes>
                                <exclude>org/isk/jvmhardcore/**</exclude>
                            </excludes-->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>truezip-maven-plugin</artifactId>
                                        <versionRange>[1.2,)</versionRange>
                                        <goals>
                                            <goal>copy</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>wagon-maven-plugin</artifactId>
                                        <versionRange>[1.0-beta-3,)</versionRange>
                                        <goals>
                                            <goal>download-single</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>build-helper-maven-plugin</artifactId>
                                        <versionRange>[1.7,)</versionRange>
                                        <goals>
                                            <goal>add-source</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
