merging repositories index for which the current user has karma.
This merged index is available in the path .indexer .
- To not generate this merged index on each request, there is a ttl value for build merged index.
- This ttl has a default value of 30 minutes. You can change it with modifying the sys props value <<<archiva.tmp.group.index.ttl>>> (see your <<<wrapper.conf>>> file)
+ To not generate this merged index on each request, there is a ttl (time to live) value for build merged index. It can be configured
+ in the repository group configuration. This ttl has a default value of 30 minutes.
-->
<systemProperty>jetty.logs=%ARCHIVA_BASE%/logs</systemProperty>
<systemProperty>java.io.tmpdir=%ARCHIVA_BASE%/temp</systemProperty>
- <systemProperty>archiva.tmp.group.index.ttl=30</systemProperty>
<systemProperty>AsyncLogger.WaitStrategy=Sleep</systemProperty>
</systemProperties>
<extraArguments>
*/
import com.google.common.io.Files;
+
import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
-import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
- private int groupMergedIndexTtl;
-
@Inject
public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
throws PlexusSisuBridgeException
indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
}
- @PostConstruct
- public void intialize()
- {
- this.groupMergedIndexTtl = Integer.getInteger( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, DEFAULT_GROUP_INDEX_TTL );
- }
-
public IndexingContext buildMergedIndex( IndexMergerRequest indexMergerRequest )
throws IndexMergerException
{
{
return this.temporaryGroupIndexes;
}
-
- public int getGroupMergedIndexTtl()
- {
- return this.groupMergedIndexTtl;
- }
}
*/
public interface IndexMerger
{
-
- /**
- * system property which contains the value in s for ttl of temporary index groups
- */
- String TMP_GROUP_INDEX_SYS_KEY = "archiva.tmp.group.index.ttl";
-
/**
* @param indexMergerRequest
* @return a temporary directory with a merge index (directory marked deleteOnExit)
void cleanTemporaryGroupIndex( TemporaryGroupIndex temporaryGroupIndex );
Collection<TemporaryGroupIndex> getTemporaryGroupIndexes();
-
- /**
- * @return ttl of temporay group index
- */
- int getGroupMergedIndexTtl();
-
}
<archiva.devMode>${archiva.devMode}</archiva.devMode>
<archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
<archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
- <archiva.tmp.group.index.ttl>${archiva.groupIndexTtl}</archiva.tmp.group.index.ttl>
<!--
not needed as we use asyncLogger in configuration
<Log4jContextSelector>org.apache.logging.log4j.core.async.AsyncLoggerContextSelector</Log4jContextSelector>