4

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?

Jinglei
  • 41
  • 2

2 Answers2

1

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.

-2

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>
khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • 1
    I tried that and used , it still sets the type to 'jar'. My files are Linux binaries without any extension. How do I set the type to no extension? – Jinglei Nov 23 '14 at 16:00
  • @jinglei @Eduardo Hernández, I tried above steps in mvn command and I could see `.` at the end of the artificat. I have used `-Dpackaging='.'` (using mvn command without pom file), output shows below `$artifactId-$version-20170718.175100-6..` Not sure how it resolved your issue? – rameshthoomu Jul 18 '17 at 18:03