how to attach additional binary artifacts without type with maven build-helper-maven-plugin

1.9k views Asked by At

I have a project that builds GO binaries without any extension and I need to install/deploy these artifacts to maven repo. I have tried build-helper-maven-plugin, but it defaults the type to 'jar'. I tried with , it still defaults to 'jar'.

Does anyone know how to set the type to nothing? Is there some other plugin you could recommend?

2

There are 2 answers

2
khmarbaise On

Just use the correct configuration which can be read in the documentation:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <!-- add configuration for antrun or another plugin here -->
      </plugin>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>some file</file>
                  <type>extension of your file </type>
                  <classifier>optional</classifier>
                </artifact>
                ...
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
0
Eduardo Hernández On

I solved this by simply setting the type to '.' (just a dot):

<type>.</type>

At least in Sonatype Nexus, the artifact is stored without extension.