Skip to content

Add generic DAQ distribution configuration and resources

Justin Lewis Salmon requested to merge packaging into master

Reinstating the work done by @bcopy to avoid duplication of DAQ packaging config by putting it in the core repo.

To enable the generation of a tarball and docker image, add the c2mon.daq.name property to the pom.xml of the specific DAQ:

  <properties>
    <c2mon.daq.name>opcua</c2mon.daq.name>
  </properties>

Then add the plugin configuration in the <build> section:

  <plugins>
    ...
    <!-- Activate plugin configurations to build a tarball and a docker image -->
    <plugin><artifactId>maven-dependency-plugin</artifactId></plugin>
    <plugin><artifactId>maven-assembly-plugin</artifactId></plugin>
    <plugin><groupId>com.spotify</groupId><artifactId>docker-maven-plugin</artifactId></plugin>
    ...
  </plugins>

In the case that a DAQ needs to add extra resources or override the default resources, point to a custom assembly descriptor in the configuration of the maven-assembly-plugin:

    <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <executions>
        <execution>
          <id>make-assembly</id>
          <phase>package</phase>
          <goals>
            <goal>single</goal>
          </goals>
          <configuration>
            <descriptors>
              <!-- Point to custom assembly descriptor -->
              <descriptor>src/dist/tar/assembly.xml</descriptor>
            </descriptors>
            <appendAssemblyId>false</appendAssemblyId>
          </configuration>
        </execution>
      </executions>
    </plugin>

Then, in the custom assembly descriptor, reference the parent component descriptor like so:

  <componentDescriptors>
    <!-- Reference the component descriptor from the parent -->
    <componentDescriptor>${project.build.directory}/distribution/tar/component.xml</componentDescriptor>
  </componentDescriptors>

Issues: #23

Merge request reports