</description>
<defaultValue>300</defaultValue>
</field>
+ <field>
+ <name>downloadRemoteIndexOnStartup</name>
+ <version>1.4.0+</version>
+ <type>boolean</type>
+ <description>
+ Schedule download of remote index when archiva start
+ </description>
+ <defaultValue>false</defaultValue>
+ </field>
</fields>
<codeSegments>
<codeSegment>
private int remoteDownloadTimeout = 300;
+ /**
+ * @since 1.4-M2
+ */
+ private boolean downloadRemoteIndexOnStartup = false;
+
public RemoteRepository()
{
this.remoteDownloadTimeout = remoteDownloadTimeout;
}
+ public boolean isDownloadRemoteIndexOnStartup()
+ {
+ return downloadRemoteIndexOnStartup;
+ }
+
+ public void setDownloadRemoteIndexOnStartup( boolean downloadRemoteIndexOnStartup )
+ {
+ this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
+ }
+
@Override
public String toString()
{
final StringBuilder sb = new StringBuilder();
- sb.append( super.toString() );
sb.append( "RemoteRepository" );
sb.append( "{url='" ).append( url ).append( '\'' );
sb.append( ", userName='" ).append( userName ).append( '\'' );
sb.append( ", remoteDownloadNetworkProxyId='" ).append( remoteDownloadNetworkProxyId ).append( '\'' );
sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
sb.append( ", remoteDownloadTimeout=" ).append( remoteDownloadTimeout );
+ sb.append( ", downloadRemoteIndexOnStartup=" ).append( downloadRemoteIndexOnStartup );
sb.append( '}' );
return sb.toString();
}
remoteRepository.setRemoteDownloadNetworkProxyId(
repositoryConfiguration.getRemoteDownloadNetworkProxyId() );
remoteRepository.setRemoteDownloadTimeout( repositoryConfiguration.getRemoteDownloadTimeout() );
+ remoteRepository.setDownloadRemoteIndexOnStartup(
+ repositoryConfiguration.isDownloadRemoteIndexOnStartup() );
remoteRepositories.add( remoteRepository );
}
return remoteRepositories;
remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId(
remoteRepository.getRemoteDownloadNetworkProxyId() );
remoteRepositoryConfiguration.setRemoteDownloadTimeout( remoteRepository.getRemoteDownloadTimeout() );
+ remoteRepositoryConfiguration.setDownloadRemoteIndexOnStartup(
+ remoteRepository.isDownloadRemoteIndexOnStartup() );
return remoteRepositoryConfiguration;
}
taskScheduler.schedule(
new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
new CronTrigger( remoteRepository.getCronExpression() ) );
+
+ if ( remoteRepository.isDownloadRemoteIndexOnStartup() )
+ {
+ log.info(
+ "remote repository {} configured with downloadRemoteIndexOnStartup schedule now a download" );
+ taskScheduler.schedule(
+ new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
+ new Date() );
+ }
}
}
<type>war</type>
<overWrite>false</overWrite>
<outputDirectory>${basedir}/src/main/webapp</outputDirectory>
- <excludes>**/web.xml,**/struts*.jar,**/sitemesh*.jar,**/struts-security.xml</excludes>
+ <excludes>**/web.xml,**/**.jar,**/struts-security.xml</excludes>
</artifactItem>
</artifactItems>
</configuration>
<s:textfield name="repository.remoteDownloadTimeout" label="Download Remote Index Timeout in seconds" size="10" required="false"/>
<s:select list="networkProxies" name="repository.remoteDownloadNetworkProxyId" emptyOption="true"
required="false" listKey="id" listValue="id" label="Network Proxy to Use for download Remote Index"/>
+<s:checkbox name="repository.downloadRemoteIndexOnStartup" label="Download remote index on Archiva startup" />