Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fracpete/maven-dependency-helper

Helper class for automatically generating Maven dependency tag snippets by querying Maven Central using the SHA-1 of the jar(s).
https://github.com/fracpete/maven-dependency-helper

dependencies-manager java maven

Last synced: 19 days ago
JSON representation

Helper class for automatically generating Maven dependency tag snippets by querying Maven Central using the SHA-1 of the jar(s).

Awesome Lists containing this project

README

        

# maven-dependency-helper
Helper class for automatically generating Maven dependency tag snippets by
querying Maven Central using the SHA-1 of the jar(s).

## Command-line

```
usage: com.github.fracpete.maven.DependencyHelper
[-h] [--jar JAR] [--dir DIR] [--include INCLUDE]
[--exclude EXCLUDE] [--proxy PROXY] [--proxy-port PROXYPORT]
[--proxy-user PROXYUSER] [--proxy-pw PROXYPW]
[--verbosity VERBOSITY]

Tools for outputting Maven dependency snippets generated from arbitrary
jars.
For this to work, the jars must be available from Maven Central.
The include/exclude order is: apply include and apply exclude.
If no include pattern is provided all files that end in '.jar' will get
added.

optional arguments:
-h, --help show this help message and exit
--jar JAR The jar(s) to process.
Either this option or '--dir' has to be provided.
Can be supplied multiple times.
--dir DIR The directory/ies containing the jars to process.
Either this option or '--jar' has to be provided.
Can be supplied multiple times.
--include INCLUDE The regular expression to use for including jars
when traversing directories.
--exclude EXCLUDE The regular expression to use for excluding jars
when traversing directories.
--proxy PROXY The proxy to use.
--proxy-port PROXYPORT
The proxy port to use.
--proxy-user PROXYUSER
The user for the proxy.
--proxy-pw PROXYPW The password for the proxy.
--verbosity VERBOSITY The verbosity level for logging output, 0 to turn
off logging.
```

## Examples

### Single jar

The following example queries Maven Central for a single jar.

```
java -jar maven-dependency-helper-0.0.2-spring-boot.jar \
--jar /some/where/5.3/iscwt-5.3.jar
```

Which results in the following output:

```xml

de.intarsys.opensource
iscwt
5.3

```

### Jars in directory

For processing all jars in a directory, but skip ones that contain `-sources`
or `-javdadoc` you can use something like this:

```
java -jar maven-dependency-helper-0.0.2-spring-boot.jar \
--dir /some/dir/ \
--exclude ".*(-sources|-javadoc).*"
```

Which will generate output like this:

```xml

de.intarsys.opensource
iscwt
5.3

de.intarsys.opensource
isfreetype
5.3

...
```

## Maven

Add the following artifact to your dependencies of your `pom.xml`:

```xml

com.github.fracpete
maven-dependency-helper
0.0.2

```

## Releases

The following releases are available:

* [0.0.2](https://github.com/fracpete/maven-dependency-helper/releases/download/maven-dependency-helper-0.0.2/maven-dependency-helper-0.0.2-spring-boot.jar)
* [0.0.1](https://github.com/fracpete/maven-dependency-helper/releases/download/maven-dependency-helper-0.0.1/maven-dependency-helper-0.0.1-spring-boot.jar)