Usage of 'Java Argument Validation' in a Maven 2 project

First: add 'Java Argument Validation' as dependency to your project.

    <dependency>
      <groupId>net.sourceforge.argval</groupId>
      <artifactId>argval</artifactId>
      <version>###</version>
    </dependency>

Next: use one of the following scenarios, so Maven 2 can find the artifact.

At this moment 'Java Argument Validation' is not available through one of the central Maven 2 repositories (like repo1.maven.org or http://download.java.net/maven/2/). Therefore one of the above scenarios is required to make the 'Java Argument Validation' available for the Maven 2 build process.

Setup 'Java Argument Validation' Maven Repository, through the pom.xml

TIP: Use this scenario when you want all current and future releases directly available, but there is no internal repository available.

The 'Java Argument Validation' artifact is located in the following Maven 2 repository http://java-arg-val.sourceforge.net/maven2/.

The xml below shows the repository definition for your projects pom.xml. This is only needed if you don't have a central Maven (proxy) repository available, like Archiva or Artifactory.

    <repository>
      <id>m2_repo_java_arg_val</id>
      <url>http://java-arg-val.sourceforge.net/maven2/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>

Setup 'Java Argument Validation' Maven Repository, through the settings.xml

TIP: Use this scenario when you want all current and future releases directly available, but there is no internal repository available.

todo

Installing the downloaded Jar into the local repository

TIP: Use this scenario when you can't or don't want to make external network connections, or want to control which (downloaded) artifacts are available.

Download the argval-###.jar direct from the Maven 2 repository at http://java-arg-val.sourceforge.net/maven2/. Or download the full distribution and unpack the archive.

Then use the Maven goal install to install the jar into the local repository (~/.m2/repository):

mvn  install:install-file  -DgroupId=net.sourceforge.argval  -DartifactId=argval \
          -Dversion=0.2  -Dpackaging=jar  -Dfile=$pathname/java_argument_validation_v0.2/argval-0.2.jar

Deploying the downloaded Jar into an internal repository

TIP: Use this scenario when you can't or don't want to make external network connections, or want to control which (downloaded) artifacts are available. And there is an internal repository available.

Download the argval-###.jar direct from the Maven 2 repository at http://java-arg-val.sourceforge.net/maven2/. Or download the full distribution and unpack the archive.

Then use the Maven goal deploy to deploy the jar into the internal repository:

mvn  install:install-file  -DgroupId=net.sourceforge.argval  -DartifactId=argval \
          -Dversion=0.2  -Dpackaging=jar  -Dfile=$pathname/java_argument_validation_v0.2/argval-0.2.jar \
          -Durl=http://$hostname:8010/archiva/repository/internal  -DrepositoryId=internal

Connecting to the 'Java Argument Validation' Maven Repository through the Archiva (proxy) Repository

TIP: Use this scenario when you want all current and future releases directly available, and there is an Archiva installation available.

  • Login to your local archiva installation;
  • Go to the menu item 'repositories';
  • Scroll down to 'Remote Repositories' and use the 'add' button;
  • Fill in the details:
  • id : m2_repo_java_arg_val
    name : Java Argument Validation Maven 2 Repository
    url : http://java-arg-val.sourceforge.net/maven2/
    type : Maven 2.x Repository
    Click 'Add Repository';
  • Go to the menu 'Proxy Connectors';
  • Use the 'Repository Proxy Connectors' button 'Add';
  • Fill in the details:
  • Network Proxy : *1
    Managed Repository : internal
    Remote Repository : m2_repo_java_arg_val
    Policies: releases: once
              snapshots: daily
              checksum: ignore *2
    Click 'Add Repository';
    *1 Choose '(direct connection)' if no http-proxy is required, or choose the configured http-proxy.
    *2 Currently no checksums are available.

Connecting to the 'Java Argument Validation' Maven Repository through the Artifactory (proxy) Repository

TIP: Use this scenario when you want all current and future releases directly available, and there is an Artifactory installation available.

To be done.