Building Commons Inject

To build Commons Inject, you have to perform the following steps:

  • Checkout the sources
  • Build the jar file
  • Install, or deploy the jar file (Optional)

Checkout the sources

svn co https://svn.apache.org/repos/asf/commons/sandbox/commons-inject/trunk/ commons-inject

The above command creates a subdirectory commons-inject with the project sources.

Build the jar file

mvn clean package

The above command assumes, that you have Apache Maven installed and in your path. The process to download and install Maven is beyond this documents scope. You can read about that elsewhere.

Install, or deploy the jar file.

To install the jar file into your local Maven repository after building it, run this command:

mvn install:install-file -DgroupId=org.apache.commons.inject -DartifactId=commons-inject
    -Dversion=<SOME_VERSION_YOU_CHOOSE> -Dfile=target/commons-inject-${project.version}.jar
    -DpomFile=pom.xml

Alternatively, you may upload the jar file into a shared Maven repository (like Nexus, or Artifactory) like this:

mvn deploy:deploy-file -DgroupId=org.apache.commons.inject -DartifactId=commons-inject
    -Dversion=<SOME_VERSION_YOU_CHOOSE> -Dfile=target/commons-inject-${project.version}.jar
    -DpomFile=pom.xml -DrepositoryUrl=<YOUR_REPO_URL> -DrepositoryId=<YOUR_REPO_ID>

Note the use of the repositoryId parameter: It is required, if your upload requires a user name and password. The actual values are read from a server entry in your Maven settings. Assuming that your repository Id is myRepoId, a suitable server entry could be

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  ...
  <servers>
    <server>
      <id>myRepoId</id>
      <username>myUsername</username>
      <password>myPassword</password>
    </server>
  </servers>
  ...
</settings>