Can Nexus or Artifactory store simple tar.gz artifacts?

心不动则不痛 提交于 2019-12-03 09:35:07
noamt

Both Artifactory and Nexus can handle any type of file, as they both are "Binary Repository Managers".

Albeit that, Nexus can technically store any file, but lacks support for binaries that do not adhere to the Maven repository layout. For example, such files will not be indexed and cannot be retrieved in searches; Also, if non-Maven artifacts encumber module information in their path, then currently Artifactory is the only repository that can make use of that and allow version based operations on artifacts (e.g., download latest version query)

Although both of these tools have started out by solving a problem in the Maven world, the need for smart binary management has been recognized in many other fields, operations included.

Binaries do need a specialized manager, and although network shares/SCM/file servers seem like a viable option in the beginning; they just don't scale.

Also see my answer to a similar question for some of the benefits of a manager over the other ad-hoc solutions.

cmonkey

Yes, you can upload non-jar files. For example:

mvn deploy:deploy-file -DgroupId=org.group.id -DartifactId=artifact-id -Dversion=0.0.0.1-SNAPSHOT -Dpackaging=tar.gz -DrepositoryId=repository-id -Durl=http://url -Dfile=localfile-0.0.0.1-SNAPSHOT.tar.gz

Newer versions of Nexus will handle certain files like tar, swf, and others by validating that they are properly formed. This may cause unexpected or unwanted behavior, though.

Is this the best way to go... only you can say based on your use cases. Factors like how often artifacts change, network latency, and others can make or break a strategy.

refs:

https://stackoverflow.com/a/33311645/32453

http://betterlogic.com/roger/2012/04/mavennexus-upload-tgztar-gz-file/

You can (see the other answers). You can also refer to them for instance like this (though an example would be nice):

You can refer to/use them like this plugin:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
      <execution>
        <id>copy</id>
        <phase>package</phase>
        <goals>
          <goal>copy</goal>
        </goals>
        <configuration>
          <artifactItems>
            <artifactItem>
              <groupId>org.apache</groupId>
              <artifactId>activemq-distro</artifactId>
              <version>5.7.0</version>
              <type>gz</type>
              <overWrite>true</overWrite>
              <outputDirectory>${project.build.directory}</outputDirectory>
            </artifactItem>
          </artifactItems>
          <!-- other configurations here -->
        </configuration>
      </execution>
    </executions>
  </plugin>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!