Snag Jar Maven Plugin

Scan a directory for java libraries identifiable as maven artifacts and perform list, install, deploy, and other operations on them.

License

License

Public domain (Unlicense)
Categories

Categories

Maven Build Tools Net
GroupId

GroupId

net.adamcin
ArtifactId

ArtifactId

snagjar-maven-plugin
Last Version

Last Version

1.3.4
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Snag Jar Maven Plugin
Scan a directory for java libraries identifiable as maven artifacts and perform list, install, deploy, and other operations on them.
Project URL

Project URL

http://adamcin.net/snagjar-maven-plugin
Source Code Management

Source Code Management

https://github.com/adamcin/snagjar-maven-plugin

Download snagjar-maven-plugin

How to add to project

<plugin>
    <groupId>net.adamcin</groupId>
    <artifactId>snagjar-maven-plugin</artifactId>
    <version>1.3.4</version>
</plugin>

Dependencies

compile (16)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.7
org.scala-lang : scala-compiler jar 2.11.7
org.scala-lang : scala-reflect jar 2.11.7
com.github.scala-incubator.io : scala-io-core_2.11 jar 0.4.3-1
com.github.scala-incubator.io : scala-io-file_2.11 jar 0.4.3-1
commons-lang : commons-lang jar 2.4
org.slf4j : slf4j-api jar 1.5.11
org.slf4j : slf4j-simple jar 1.5.11
org.slf4j : jcl-over-slf4j jar 1.5.11
org.slf4j : log4j-over-slf4j jar 1.5.11
org.codehaus.plexus : plexus-utils jar 3.0.24
org.codehaus.plexus : plexus-digest jar 1.1
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven : maven-core jar 3.3.9
org.apache.maven : maven-model jar 3.3.9
org.apache.maven : maven-artifact jar 3.3.9

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.scalatest : scalatest_2.11 jar 2.2.6
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

Snag Jar Maven Plugin (snagjar-maven-plugin)

maven plugin info

Maven plugin written in Scala to allow installation and deployment of arbitrary jars into local and remote m2 repos based on embedded maven metadata.

Installation

To enable shorthand execution of the plugin from the command-line, you must add the groupId to your pluginGroups element in your maven settings.xml file:

<pluginGroups>
  <pluginGroup>net.adamcin</pluginGroup>
</pluginGroups>

Usage

The snagjar-maven-plugin provides 5 goals:

  • to-log: Prints the details of snagged artifacts to the maven log
  • to-deps: Generates a maven pom file containing a sorted list of unique captured artifacts as dependencies in a dependencyManagement element
  • to-local: Installs snagged artifacts to the local maven repository
  • to-remote: Deploys snagged artifacts to a remote maven repository
  • help: Prints a list of the plugin's goals and available parameters for each, though without javadoc-based documentation because the Mojos are written in Scala

To install all the jars in the current directory into the local maven repository:

mvn snagjar:to-local

To recursively scan the current directory for artifacts and generate a dependencyManagement section with all dependencies defined as having provided scope:

mvn snagjar:to-deps -Drecursive=true -Dscope=provided

To identify a single jar using the to-log mojo:

mvn snagjar:to-log -DsnagFile=someBundle.jar

To recursively scan a CQ installation directory for bundles and deploy them to a remote repo in order to populate it with project dependencies:

mvn snagjar:to-remote -DsnagFile=crx-quickstart -Drecursive=true -DrepositoryId=thirdparty -Durl=http://example.corp.com/repository/thirdparty/content

To recursively scan a CQ installation directory and generate a dependencyManagement section that only includes proprietary libraries:

mvn snagjar:to-deps -Dfilter=com.* -Drecursive=true -DsnagFile=crx-quickstart -DdepsFile=C:/workspace/cq55platform/pom.xml

Versions

Version
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.0
1.0.0
0.8.2
0.8.0