<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>de.matrixweb.smaller</groupId>
    <artifactId>bundles</artifactId>
    <version>0.8.0</version>
  </parent>
  <artifactId>browserify</artifactId>
  <packaging>bundle</packaging>

  <name>Smaller :: Bundles :: browserify</name>

  <dependencies>
    <dependency>
      <groupId>de.matrixweb.nodejs</groupId>
      <artifactId>nodejs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>${osgi.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>common</artifactId>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>resource</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>de.matrixweb.smaller</groupId>
        <artifactId>smaller-node-builder-maven-plugin</artifactId>
        <configuration>
          <type>js</type>
          <merging>true</merging>
          <npm-only>true</npm-only>
          <script-file>src/main/resources/browserify.js</script-file>
          <use-runtime-script>true</use-runtime-script>
        </configuration>
        <executions>
          <execution>
            <id>browserify-2.34.0</id>
            <configuration>
              <name>browserify-2.34.0</name>
              <packages>
                <package>browserify@2.34.0</package>
                <package>through@2.3.4</package>
                <package>convert-source-map@0.3.1</package>
                <package>mkdirp@0.3.5</package>

                <package>coffeeify@0.6.0</package>
              </packages>
            </configuration>
            <goals>
              <goal>smaller-node-builder</goal>
            </goals>
          </execution>
          <execution>
            <id>browserify-3.24.9</id>
            <configuration>
              <name>browserify-3.24.9</name>
              <packages>
                <package>browserify@3.24.9</package>
                <package>browser-resolve@1.2.2</package>
                
                <package>through@2.3.4</package>
                <package>convert-source-map@0.3.1</package>
                <package>mkdirp@0.3.5</package>

                <package>coffeeify@0.6.0</package>
              </packages>
            </configuration>
            <goals>
              <goal>smaller-node-builder</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>add-resource</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>${basedir}/target/generated-resources/npm-modules</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package />
            <Bundle-Activator>de.matrixweb.smaller.browserify.Activator</Bundle-Activator>
          </instructions>
        </configuration>
      </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>de.matrixweb.smaller</groupId>
                    <artifactId>
                      smaller-node-builder-maven-plugin
                    </artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>smaller-node-builder</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
