mirror of
https://github.com/apache/archiva.git
synced 2025-02-12 04:56:02 +00:00
working on getting the cli working again
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@528251 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
73d6702f8d
commit
67fd82cfad
@ -39,17 +39,14 @@
|
||||
<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>
|
||||
@ -74,6 +71,11 @@
|
||||
<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>
|
||||
@ -88,6 +90,24 @@
|
||||
</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>
|
||||
|
@ -24,6 +24,7 @@
|
||||
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;
|
||||
@ -69,6 +70,8 @@ public class ArchivaCli
|
||||
public static final char CONSUMERS = 'u';
|
||||
|
||||
public static final char LIST_CONSUMERS = 'l';
|
||||
|
||||
public static final char DUMP_CONFIGURATION = 'd';
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Properties controlling Repository conversion
|
||||
@ -80,6 +83,13 @@ public class ArchivaCli
|
||||
|
||||
public static final String BLACKLISTED_PATTERNS = "blacklistPatterns";
|
||||
|
||||
/**
|
||||
* Configuration store.
|
||||
*
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ArchivaConfiguration archivaConfiguration;
|
||||
|
||||
public static void main( String[] args )
|
||||
throws Exception
|
||||
{
|
||||
@ -122,6 +132,9 @@ public Options buildCliOptions( Options options )
|
||||
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;
|
||||
}
|
||||
|
||||
@ -140,6 +153,10 @@ else if ( cli.hasOption( LIST_CONSUMERS ) )
|
||||
{
|
||||
dumpAvailableConsumers( plexus );
|
||||
}
|
||||
else if ( cli.hasOption( DUMP_CONFIGURATION ) )
|
||||
{
|
||||
dumpConfiguration( plexus );
|
||||
}
|
||||
else
|
||||
{
|
||||
displayHelp();
|
||||
@ -279,4 +296,11 @@ private void doConversion( CommandLine cli, PlexusContainer plexus )
|
||||
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() );
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
<?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>
|
Loading…
x
Reference in New Issue
Block a user