# Maven assemble plugin in extensions

**URL:** <https://forum.openrefine.org/t/maven-assemble-plugin-in-extensions/92>\
**Category:** Development & Design\
**Tags:** extensions\
**Created:** [November 14, 2022, 8:54am UTC](https://forum.openrefine.org/t/maven-assemble-plugin-in-extensions/92 "2022-11-14T08:54:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/jan/32/48_2.png) [@Jan](https://forum.openrefine.org/u/Jan)\
**Post date:** [November 14, 2022, 8:54am UTC](https://forum.openrefine.org/t/maven-assemble-plugin-in-extensions/92/1 "2022-11-14T08:54:54Z")

</div>

Hi there,

In order to package and distribute my own extension and install it on someone else’s OpenRefine installation, I use the `maven-assembly-plugin` with a simple config.

It simply creates a zip of the `module` folder and I wonder if that should be added to the sample extension in the main repo.

- extension-zip.xml

```xml
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 http://maven.apache.org/xsd/assembly-2.1.1.xsd">
    <id>zip</id>
    <includeBaseDirectory>true</includeBaseDirectory>

    <formats>
        <format>zip</format>
    </formats>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}/module</directory>
        </fileSet>
    </fileSets>
</assembly>

```

- pom.xml:

```xml
  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-assembly-plugin</artifactId>
      <executions>
          <execution>
              <phase>package</phase>
              <goals>
                  <goal>single</goal>
              </goals>
              <configuration>
                  <appendAssemblyId>false</appendAssemblyId>
                  <descriptors>
                      <descriptor>${project.basedir}/extension-zip.xml</descriptor>
                  </descriptors>
              </configuration>
          </execution>
      </executions>
  </plugin>

```

`mvn package` or `mvn install` then output the zip file which can be simply unpacked in an existing Refine installation.

wdyt?

---

<div class="post-metadata">

**Author:** ![antonin\_d](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/antonin_d/32/32_2.png) [@antonin\_d](https://forum.openrefine.org/u/antonin_d)\
**Post date:** [November 14, 2022, 6:13pm UTC](https://forum.openrefine.org/t/maven-assemble-plugin-in-extensions/92/2 "2022-11-14T18:13:58Z")

</div>

Thanks for sharing!

I have also used similar a similar approach for various extensions. In general, if your module extends the backend, you will also need to make sure that either the build is configured to output the corresponding `.class` and `.jar` files appropriately in that `module` subdirectory, or you can include them at packaging time by extending the assembly definition.

I don’t know if the main repository is the best place to store those examples as such. I think they are more useful as part of a complete example with a `pom.xml` file and corresponding project structure. But surely it would be worth mentioning this in the documentation (with a pointer to a fully fledged example).

I think it would be nice to offer a Maven archetype for OpenRefine extensions - I am not super familiar with archetypes but I think they are designed precisely for use cases like this one.
