<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>
  <parent>
    <groupId>org.dcm4che</groupId>
    <artifactId>dcm4che-parent</artifactId>
    <version>3.3.4-ASB1</version>
  </parent>
  <artifactId>dcm4che-javascript</artifactId>
  <name>dcm4che-javascript</name>
  <description>Provide Javascript API for DICOM Dictionary</description>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xml-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>transform</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <transformationSets>
            <transformationSet>
              <dir>src/main/scripts/xml</dir>
              <includes>
                <include>p6_element.xml</include>
              </includes>
              <stylesheet>src/main/scripts/xsl/json_dict.xsl</stylesheet>
              <outputDir>${basedir}/target/generated-resources/js</outputDir>
              <fileMappers>
                <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
                  <targetName>dict.js</targetName>
                </fileMapper>
              </fileMappers>
            </transformationSet>
          </transformationSets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>yuicompressor-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compress</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>${basedir}/target/generated-resources/js</sourceDirectory>
          <splitDependencies>false</splitDependencies>
          <outputDirectory>${basedir}/target/generated-resources/js</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${basedir}/target/generated-resources/js/dict.js</file>
                  <type>js</type>
                  <classifier>full</classifier>
                </artifact>
                <artifact>
                  <file>${basedir}/target/generated-resources/js/dict-min.js</file>
                  <type>js</type>
                  <classifier>min</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <configuration>
              <classesDirectory>${basedir}/target/generated-resources</classesDirectory>
              <outputDirectory>${basedir}/target/</outputDirectory>
              <includeEmptyDirs>false</includeEmptyDirs>
              <archive>
                <addMavenDescriptor>false</addMavenDescriptor>
              </archive>
            </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>net.alchim31.maven</groupId>
                    <artifactId>yuicompressor-maven-plugin</artifactId>
                    <versionRange>[1.4.0,)</versionRange>
                    <goals>
                      <goal>compress</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>
