<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-core-consumers</artifactId>
- <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-database-consumers</artifactId>
- <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-lucene-consumers</artifactId>
- <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.registry</groupId>
+ <artifactId>plexus-registry-commons</artifactId>
+ <version>1.0-alpha-2</version>
+ </dependency>
</dependencies>
<build>
<plugins>
</archive>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>merge</id>
+ <goals>
+ <goal>merge-descriptors</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+ <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
import org.apache.commons.cli.Options;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.common.utils.DateUtil;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.consumers.ConsumerException;
import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
import org.apache.maven.archiva.converter.RepositoryConversionException;
public static final char CONSUMERS = 'u';
public static final char LIST_CONSUMERS = 'l';
+
+ public static final char DUMP_CONFIGURATION = 'd';
// ----------------------------------------------------------------------------
// Properties controlling Repository conversion
public static final String BLACKLISTED_PATTERNS = "blacklistPatterns";
+ /**
+ * Configuration store.
+ *
+ * @plexus.requirement
+ */
+ private ArchivaConfiguration archivaConfiguration;
+
public static void main( String[] args )
throws Exception
{
Option listConsumersOption = createOption( LIST_CONSUMERS, "listconsumers", 0, "List available consumers." );
options.addOption( listConsumersOption );
+ Option dumpConfig = createOption( DUMP_CONFIGURATION, "dumpconfig", 0, "Dump Current Configuration." );
+ options.addOption( dumpConfig );
+
return options;
}
{
dumpAvailableConsumers( plexus );
}
+ else if ( cli.hasOption( DUMP_CONFIGURATION ) )
+ {
+ dumpConfiguration( plexus );
+ }
else
{
displayHelp();
showFatalError( "Error converting repository.", e, true );
}
}
+
+ private void dumpConfiguration( PlexusContainer plexus ) throws ComponentLookupException
+ {
+ archivaConfiguration = (ArchivaConfiguration) plexus.lookup( ArchivaConfiguration.ROLE );
+
+ System.out.println( "File Type Count: " + archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().size() );
+ }
}
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<components>
+ <component>
+ <role>org.codehaus.plexus.registry.Registry</role>
+ <implementation>
+ org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry
+ </implementation>
+ <role-hint>commons-configuration</role-hint>
+ <configuration>
+ <properties>
+ <system />
+ <xml fileName="${user.home}/.m2/archiva.xml"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.user"
+ config-at="org.apache.maven.archiva" />
+ <xml fileName="${user.home}/.m2/shared.xml"
+ config-optional="true"
+ config-name="org.apache.maven.shared.app.user"
+ config-at="org.apache.maven.shared.app"
+ config-forceCreate="true" />
+ <properties fileName="${user.home}/.m2/security.properties"
+ config-optional="true"
+ config-at="org.codehaus.plexus.security" />
+ <properties fileName="${user.home}/.m2/archiva.properties"
+ config-optional="true"
+ config-at="org.codehaus.plexus.security" />
+ <xml fileName="org/apache/maven/archiva/configuration/default-archiva.xml"
+ config-optional="true"
+ config-at="org.apache.maven.archiva"/>
+ </properties>
+ </configuration>
+ </component>
+</components>