protoj.core
Class RetrieveFeature

java.lang.Object
  extended by protoj.core.RetrieveFeature

public final class RetrieveFeature
extends java.lang.Object

Retrieves dependency artifacts and places them in the project lib directory. By default ivy is used to perform the download and requires an ivy xml file to be placed on the classpath that describes the project dependencies.

Alternatively maven can be used to perform the download, which requires a maven pom file to be placed on the classpath that describes the project dependencies.

The following options are supported:

  1. -maven: use maven ant tasks to perform the dependency download. If this switch isn't specified then ivy is used instead.

When choosing between ivy and maven, be aware that transitive dependency downloading can be turned off with ivy but not with maven.

Author:
Ashley Williams

Constructor Summary
RetrieveFeature(CoreProject parent)
          Creates with the owning parent.
 
Method Summary
 org.apache.tools.ant.taskdefs.Copy getCopyClasses()
          The ant task used to copy the repository classes jar files to the lib directory.
 org.apache.tools.ant.taskdefs.Copy getCopyJavadocs()
          The ant task used to copy the repository javadocs jar files to the lib directory.
 org.apache.tools.ant.taskdefs.Copy getCopySources()
          The ant task used to copy the repository sources jar files to the lib directory.
 org.apache.maven.artifact.ant.DependenciesTask getDependencies()
          The maven ant task used to update the repository with the project dependencies.
 java.io.File getIvyFile()
          The ivy file used to define project dependencies.
 org.apache.ivy.ant.IvyRetrieve getIvyRetrieve()
          The ivy ant task used to update the repository with the project dependencies.
 java.io.File getMavenFile()
          The maven pom file used to define project dependencies.
 CoreProject getParent()
          The parent of this feature.
 java.io.File getWorkingDir()
          The directory where the ivy and maven files are extracted to.
 void initConfig(java.lang.String ivyConfig, java.lang.String mavenConfig, ArgRunnable<RetrieveFeature> config)
          Configures with the classpath locations of the config files.
 void ivyRetrieve()
          Downloads the dependencies described in the project ivy.xml file under the conf directory to the lib directory.
 void mavenRetrieve()
          Downloads the dependencies described in the project pom.xml file under the conf directory to the lib directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetrieveFeature

public RetrieveFeature(CoreProject parent)
Creates with the owning parent.

Parameters:
parent -
Method Detail

initConfig

public void initConfig(java.lang.String ivyConfig,
                       java.lang.String mavenConfig,
                       ArgRunnable<RetrieveFeature> config)
Configures with the classpath locations of the config files.

Parameters:
ivyConfig - the resource path of the ivy config file, can be null if ivy isn't used. For example "/acme/ivy.xml"
mavenConfig - the resource path of the maven config file, can be null if ivy isn't used. For example "/acme/pom.xml"
config - the instance that gets called back when mavenRetrieve() is invoked so that further configuration of this feature may be applied.

ivyRetrieve

public void ivyRetrieve()
Downloads the dependencies described in the project ivy.xml file under the conf directory to the lib directory. Just before execution of the ant task, any configuration provided via a call to initConfig(String, String, ArgRunnable) will be called back so that further configuration of this feature may be applied.

Hint: use this ivy based method when you don't want transitive dependencies since there doesn't seem to be a way to disable this when using maven.


mavenRetrieve

public void mavenRetrieve()
Downloads the dependencies described in the project pom.xml file under the conf directory to the lib directory. Just before execution of the ant task, any configuration provided via a call to initConfig(String, String, ArgRunnable) will be called back so that further configuration of this feature may be applied.


getParent

public CoreProject getParent()
The parent of this feature.

Returns:

getIvyRetrieve

public org.apache.ivy.ant.IvyRetrieve getIvyRetrieve()
The ivy ant task used to update the repository with the project dependencies.

Returns:

getDependencies

public org.apache.maven.artifact.ant.DependenciesTask getDependencies()
The maven ant task used to update the repository with the project dependencies.

Returns:

getCopyClasses

public org.apache.tools.ant.taskdefs.Copy getCopyClasses()
The ant task used to copy the repository classes jar files to the lib directory.

Returns:

getCopyJavadocs

public org.apache.tools.ant.taskdefs.Copy getCopyJavadocs()
The ant task used to copy the repository javadocs jar files to the lib directory.

Returns:

getCopySources

public org.apache.tools.ant.taskdefs.Copy getCopySources()
The ant task used to copy the repository sources jar files to the lib directory.

Returns:

getIvyFile

public java.io.File getIvyFile()
The ivy file used to define project dependencies.

Returns:

getMavenFile

public java.io.File getMavenFile()
The maven pom file used to define project dependencies.

Returns:

getWorkingDir

public java.io.File getWorkingDir()
The directory where the ivy and maven files are extracted to.

Returns: