/**
* Plexus registry to read the configuration from.
- *
*/
@Inject
@Named( value = "commons-configuration" )
}
}
-
new ConfigurationRegistryWriter().write( configuration, section );
section.save();
}
// olamy hackish I know :-)
- contents = "<configuration><xml fileName=\"" + fileLocation +"\" config-forceCreate=\"true\" config-name=\"org.apache.maven.archiva.user\"/>"
- + "</configuration>";
-
+ contents = "<configuration><xml fileName=\"" + fileLocation
+ + "\" config-forceCreate=\"true\" config-name=\"org.apache.maven.archiva.user\"/>" + "</configuration>";
( (CommonsConfigurationRegistry) registry ).setProperties( contents );
{
ExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator();
expressionEvaluator.addExpressionSource( new SystemPropertyExpressionSource() );
- userConfigFilename = expressionEvaluator.expand( userConfigFilename );
+ String userConfigFileNameSysProps = System.getProperty( "archiva.user.configFileName" );
+ if ( StringUtils.isNotBlank( userConfigFileNameSysProps ) )
+ {
+ userConfigFilename = userConfigFileNameSysProps;
+ }
+ else
+ {
+ userConfigFilename = expressionEvaluator.expand( userConfigFilename );
+ }
altConfigFilename = expressionEvaluator.expand( altConfigFilename );
loadConfiguration();
}
c.setRefreshCronExpression( unescapeCronExpression( c.getRefreshCronExpression() ) );
}
-
-
return config;
}
<appserver.base>${basedir}/target/appserver-base</appserver.base>
<plexus.home>${project.build.outputDirectory}</plexus.home>
<java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir>
+ <archiva.user.configFileName>${basedir}/target/archiva.xml</archiva.user.configFileName>
</systemPropertyVariables>
</configuration>
</plugin>
</property>
</bean>
+ <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <property name="properties">
+ <value>
+ <![CDATA[
+ <configuration>
+ <system/>
+ <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </configuration>
+ ]]>
+ </value>
+ </property>
+ </bean>
+
</beans>
\ No newline at end of file
<property name="archivaConfiguration" ref="archivaConfiguration#cleanup-released-snapshots"/>
</bean>
+ <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <property name="properties">
+ <value>
+ <![CDATA[
+ <configuration>
+ <system/>
+ <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </configuration>
+ ]]>
+ </value>
+ </property>
+ </bean>
</beans>
\ No newline at end of file
<property name="archivaConfiguration" ref="archivaConfiguration#days-old"/>
</bean>
+ <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <property name="properties">
+ <value>
+ <![CDATA[
+ <configuration>
+ <system/>
+ <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </configuration>
+ ]]>
+ </value>
+ </property>
+ </bean>
+
</beans>
\ No newline at end of file
<context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.metadata.repository"/>
+ <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <property name="properties">
+ <value>
+ <![CDATA[
+ <configuration>
+ <system/>
+ <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </configuration>
+ ]]>
+ </value>
+ </property>
+ </bean>
+
</beans>
\ No newline at end of file