Find a Class in a bunch of JAR Files

Flattr this!

for j in *.jar; do echo $j:; jar -tvf "$j" | grep -Hsi ClassName; done

  1. Iterate over every jar in your folder.
  2. Output every JAR Name (to match found classes to JARs lateron)
  3. List Content of every JAR ( jar -tvf “$j” )
  4. Grep for that specific ClassName grep -Hsi ClassName

Original Post: https://coderwall.com/p/7d-mta/find-a-class-in-a-bunch-of-jar-files

use 3rd party Dependencies in your Maven Project

Flattr this!

Deploy your JAR to your local (file) Repository. You shold also commit this to your CVM System. You can also add JARs as Javadoc or Source.

    mvn deploy:deploy-file \
        -DgroupId=<group-id> \
        -DartifactId=<artifact-id> \
        -Dversion=<version> \
        -Dfile=<path-to-file> \
        -Dpackaging=jar \
        -Durl=file:///<project-dir>/repo 
        ( -Dclassifier=javadoc | sources  )

You can now use these JARs in your pom File if they were in a normal Repository:

    <project>
        ...
        <repositories>
        ...
            <repository>
                <id>project.local</id>
                <name>project</name>
                <url>file:${project.basedir}/repo</url>
            </repository>     
        ...
        </repositories>
        ...
    </project>

Original Post: https://coderwall.com/p/r28cew/use-3rd-party-dependencies-in-maven-project