<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>errai-client-local-class-hider</artifactId>
  <packaging>jar</packaging>
  <url>http://www.jboss.org/errai</url>
  <name>Errai::Client::Local::Class::Hider</name>

  <description>
    A Java Agent designed to hide the web of classes that should only be deployed as
    compiled JavaScript and executed in the web browser.
  </description>

  <!-- Parent -->
  <parent>
    <groupId>org.jboss.errai</groupId>
    <artifactId>errai-parent</artifactId>
    <version>3.1.1.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>      
    </dependency>
  </dependencies>
  
  <build>
   <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
            <index>false</index>
          </archive>
        </configuration>
      </plugin>
      
      <!-- The agent uses asm to generate the classes, but although asm is generally available
           in app servers already, the module systems may hide it from the system classloader. 
           Safest alternative is to jarjar it into a custom package. -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>jarjar-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jarjar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org.ow2.asm:asm</include>
              </includes>
              <rules>
                <rule>
                  <pattern>org.objectweb.asm.**</pattern>
                  <result>org.jboss.errai.classhider.internal.asm.@1</result>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <!-- DistributionManagement -->
  <distributionManagement>
    <repository>
      <id>jboss-releases-repository</id>
      <name>JBoss Releases Repository</name>
      <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
    </repository>

    <snapshotRepository>
      <id>jboss-snapshots-repository</id>
      <name>JBoss Snapshots Repository</name>
      <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  
</project>
