Usage

The CRX Maven Plugin is used to package and sign a Google Chrome Extension. There are two ways to use the CRX Maven Plugin.

If the packaging type defined in the pom.xml is crx, the package lifecycle phase can be used:

mvn package

or using the crx:crx goal:

mvn crx:crx

Using the crx packaging

To enable the crx packaging type, the POM or one of its ancestors you must include this plugin dependency declaration with <extensions/> set to true.

<project>
  ...
  <packaging>crx</packaging>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>com.btmatthews.maven.plugins</groupId>
        <artifactId>crx-maven-plugin</artifactId>
        <version>1.2.1</version>
        <extensions>true</extensions>
        <configuration>
          ...
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

Using the crx:crx goal

When the Google Chrome Extension is not the primary artifact being produced you only need to include this plugin dependency declaration.

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>com.btmatthews.maven.plugins</groupId>
        <artifactId>crx-maven-plugin</artifactId>
        <version>1.2.1</version>
        <configuration>
          ...
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

You should add the com.btmatthews.maven.plugins prefix to <pluginGroups/> in your ~/settings.xml in order to avoid having to supply explicitly specify the groupId when invoking the crx:crx goal.

<pluginGroups>
  ...
  <pluginGroup>com.btmatthews.maven.plugins</pluginGroup>
  ...
 </pluginGroups>