private ArtifactRepositoryPolicy getReleasesPolicy()
{
- //todo get policy configuration from ProxyConfiguration
- return new ArtifactRepositoryPolicy();
+ return config.getCacheReleasePolicy();
}
private ArtifactRepositoryPolicy getSnapshotsPolicy()
{
- //todo get policy configuration from ProxyConfiguration
- return new ArtifactRepositoryPolicy();
+ return config.getCacheSnapshotPolicy();
}
public URL getRepositoryCacheURL()
* limitations under the License.
*/
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.repository.proxy.repository.ProxyRepository;
import org.apache.maven.wagon.proxy.ProxyInfo;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.List;
import java.util.Iterator;
+import java.util.List;
/**
* Class to represent the configuration file for the proxy
private ProxyInfo httpProxy;
+ private ArtifactRepositoryPolicy cacheReleasePolicy;
+
+ private ArtifactRepositoryPolicy cacheSnapshotPolicy;
+
/**
* Used to set the location where the proxy should cache the configured repositories
*
}
}
}
+
+ public ArtifactRepositoryPolicy getCacheReleasePolicy()
+ {
+ if ( cacheReleasePolicy == null )
+ {
+ cacheReleasePolicy = new ArtifactRepositoryPolicy();
+ }
+
+ return cacheReleasePolicy;
+ }
+
+ public void setCacheReleasePolicy( ArtifactRepositoryPolicy cacheReleasePolicy )
+ {
+ this.cacheReleasePolicy = cacheReleasePolicy;
+ }
+
+ public ArtifactRepositoryPolicy getCacheSnapshotPolicy()
+ {
+ if ( cacheSnapshotPolicy == null )
+ {
+ cacheSnapshotPolicy = new ArtifactRepositoryPolicy();
+ }
+
+ return cacheSnapshotPolicy;
+ }
+
+ public void setCacheSnapshotPolicy( ArtifactRepositoryPolicy cacheSnapshotPolicy )
+ {
+ this.cacheSnapshotPolicy = cacheSnapshotPolicy;
+ }
}