<value>org.apache.maven.archiva.configuration</value>
</default>
</defaults>
- <!-- TODO! break out subtypes such as <discovery> and create a list of blacklist -->
<classes>
<class rootElement="true" xml.tagName="configuration">
<name>Configuration</name>
<field>
<name>globalBlackListPatterns</name>
<version>1.0.0</version>
- <type>String</type>
<description>Blacklisted patterns in the discovery process</description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
</field>
<field>
<name>proxy</name>
<field>
<name>blackListPatterns</name>
<version>1.0.0</version>
- <type>String</type>
<description>Blacklisted patterns in the discovery process</description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
</field>
</fields>
</class>
if ( repositoryConfiguration.isIndexed() )
{
- // TODO! include global ones
- String blacklistedPatterns = repositoryConfiguration.getBlackListPatterns();
+ List blacklistedPatterns = new ArrayList();
+ if ( repositoryConfiguration.getBlackListPatterns() != null )
+ {
+ blacklistedPatterns.addAll( repositoryConfiguration.getBlackListPatterns() );
+ }
+ if ( configuration.getGlobalBlackListPatterns() != null )
+ {
+ blacklistedPatterns.addAll( configuration.getGlobalBlackListPatterns() );
+ }
boolean includeSnapshots = repositoryConfiguration.isIncludeSnapshots();
ArtifactRepository repository = repoFactory.createRepository( repositoryConfiguration );
"**/*.MD5", "**/*.sha1", "**/*.SHA1", "**/*snapshot-version", "*/website/**", "*/licenses/**", "*/licences/**",
"**/.htaccess", "**/*.html", "**/*.asc", "**/*.txt", "**/*.xml", "**/README*", "**/CHANGELOG*", "**/KEYS*"};
- private List scanForArtifactPaths( File repositoryBase, String blacklistedPatterns, long comparisonTimestamp )
+ private List scanForArtifactPaths( File repositoryBase, List blacklistedPatterns, long comparisonTimestamp )
{
return scanForArtifactPaths( repositoryBase, blacklistedPatterns, null, STANDARD_DISCOVERY_EXCLUDES,
comparisonTimestamp );
}
- public List discoverArtifacts( ArtifactRepository repository, String operation, String blacklistedPatterns,
+ public List discoverArtifacts( ArtifactRepository repository, String operation, List blacklistedPatterns,
boolean includeSnapshots )
throws DiscovererException
{
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
import org.codehaus.plexus.util.xml.Xpp3DomWriter;
return kickedOutPaths.iterator();
}
- protected List scanForArtifactPaths( File repositoryBase, String blacklistedPatterns, String[] includes,
+ protected List scanForArtifactPaths( File repositoryBase, List blacklistedPatterns, String[] includes,
String[] excludes, long comparisonTimestamp )
{
List allExcludes = new ArrayList();
{
allExcludes.addAll( Arrays.asList( excludes ) );
}
-
- if ( !StringUtils.isEmpty( blacklistedPatterns ) )
+ if ( blacklistedPatterns != null )
{
- allExcludes.addAll( Arrays.asList( blacklistedPatterns.split( "," ) ) );
+ allExcludes.addAll( blacklistedPatterns );
}
DirectoryScanner scanner = new DirectoryScanner();
* @return the list of artifacts discovered
* @throws DiscovererException if there was an unrecoverable problem discovering artifacts or recording progress
*/
- List discoverArtifacts( ArtifactRepository repository, String operation, String blacklistedPatterns,
+ List discoverArtifacts( ArtifactRepository repository, String operation, List blacklistedPatterns,
boolean includeSnapshots )
throws DiscovererException;
*/
private static final String[] STANDARD_DISCOVERY_INCLUDES = {"**/maven-metadata.xml"};
- public List discoverMetadata( ArtifactRepository repository, String operation, String blacklistedPatterns )
+ public List discoverMetadata( ArtifactRepository repository, String operation, List blacklistedPatterns )
throws DiscovererException
{
if ( !"file".equals( repository.getProtocol() ) )
* @param operation the operation being performed (used for timestamp comparison)
* @param blacklistedPatterns Patterns that are to be excluded from the discovery process.
* @return the list of artifacts found
+ * @throws DiscovererException if there is a problem during the discovery process
*/
- List discoverMetadata( ArtifactRepository repository, String operation, String blacklistedPatterns )
+ List discoverMetadata( ArtifactRepository repository, String operation, List blacklistedPatterns )
throws DiscovererException;
}
public class DefaultArtifactDiscovererTest
extends AbstractArtifactDiscovererTest
{
+ private static final List JAVAX_BLACKLIST = Collections.singletonList( "javax/**" );
+
protected String getLayout()
{
return "default";
public void testBlacklistedExclude()
throws DiscovererException
{
- List artifacts = discoverer.discoverArtifacts( repository, TEST_OPERATION, "javax/**", false );
+ List artifacts = discoverer.discoverArtifacts( repository, TEST_OPERATION, JAVAX_BLACKLIST, false );
assertNotNull( "Check artifacts not null", artifacts );
boolean found = false;
for ( Iterator i = discoverer.getExcludedPathsIterator(); i.hasNext() && !found; )
import java.io.File;
import java.net.MalformedURLException;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
* Test the legacy artifact discoverer.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id$
+ * @version $Id:LegacyArtifactDiscovererTest.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $
*/
public class LegacyArtifactDiscovererTest
extends AbstractArtifactDiscovererTest
{
+ private static final List JAVAX_SQL_BLACKLIST = Collections.singletonList( "javax.sql/**" );
+
protected String getLayout()
{
return "legacy";
public void testBlacklistedExclude()
throws DiscovererException
{
- List artifacts = discoverer.discoverArtifacts( repository, TEST_OPERATION, "javax.sql/**", false );
+ List artifacts = discoverer.discoverArtifacts( repository, TEST_OPERATION, JAVAX_SQL_BLACKLIST, false );
assertNotNull( "Check artifacts not null", artifacts );
boolean found = false;
for ( Iterator i = discoverer.getExcludedPathsIterator(); i.hasNext() && !found; )
protected void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException
{
- // TODO!
+ // TODO! delete it
}
}
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
<html>
<head>
<h1>Administration</h1>
<div id="contentArea">
-<h2>Proxied Repositories</h2>
+ <h2>Proxied Repositories</h2>
-<ww:set name="proxiedRepositories" value="proxiedRepositories"/>
-<c:if test="${empty(proxiedRepositories)}">
- <strong>There are no proxied repositories configured yet.</strong>
-</c:if>
-<c:forEach items="${proxiedRepositories}" var="repository" varStatus="i">
-<div>
-<div style="float: right">
- <%-- TODO replace with icons --%>
- <a href="<ww:url action="editProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
- Repository</a> | <a
- href="<ww:url action="deleteProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Delete
- Repository</a>
-</div>
-<h3>${repository.name}</h3>
-<table>
- <tr>
- <th>Identifier</th>
- <td>
- <code>${repository.id}</code>
- </td>
- </tr>
- <tr>
- <th>URL</th>
- <td><a href="${repository.url}">${repository.url}</a></td>
- </tr>
- <tr>
- <th>Type</th>
- <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%>
- <td>
- <c:choose>
- <c:when test="${repository.layout == 'default'}">
- Maven 2.x Repository
- </c:when>
- <c:otherwise>
- Maven 1.x Repository
- </c:otherwise>
- </c:choose>
- </td>
- </tr>
- <tr>
- <th>Snapshots</th>
- <td>
- <%-- TODO! turn into a tag --%>
- <c:choose>
- <c:when test="${repository.snapshotsPolicy == 'disabled'}">
- Disabled
- </c:when>
- <c:when test="${repository.snapshotsPolicy == 'always'}">
- Updated every request
- </c:when>
- <c:when test="${repository.snapshotsPolicy == 'hourly'}">
- Updated hourly
- </c:when>
- <c:when test="${repository.snapshotsPolicy == 'daily'}">
- Updated daily
- </c:when>
- <c:when test="${repository.snapshotsPolicy == 'interval'}">
- Updated every ${repository.snapshotsInterval} minutes
- </c:when>
- </c:choose>
- </td>
- </tr>
- <tr>
- <th>Releases</th>
- <td>
- <%-- TODO! turn into a tag --%>
- <c:choose>
- <c:when test="${repository.releasesPolicy == 'disabled'}">
- Disabled
- </c:when>
- <c:when test="${repository.releasesPolicy == 'always'}">
- Updated every request
- </c:when>
- <c:when test="${repository.releasesPolicy == 'hourly'}">
- Updated hourly
- </c:when>
- <c:when test="${repository.releasesPolicy == 'daily'}">
- Updated daily
- </c:when>
- <c:when test="${repository.releasesPolicy == 'interval'}">
- Updated every ${repository.releasesInterval} minutes
- </c:when>
- </c:choose>
- </td>
- </tr>
- <tr>
- <th>Proxied through</th>
- <td>
- <%-- TODO: this is the hard way! would be nice if there was a ref in the model so it was directly linked --%>
- ${repositoriesMap[repository.managedRepository].name}
- (<code>${repositoriesMap[repository.managedRepository].id}</code>)
- </td>
- </tr>
- <tr>
- <th>Use HTTP Proxy</th>
- <td class="${repository.useNetworkProxy ? 'doneMark' : 'errorMark'}"></td>
- </tr>
- <tr>
- <th>Cache Failures</th>
- <td class="${repository.cacheFailures ? 'doneMark' : 'errorMark'}"></td>
- </tr>
- <tr>
- <th>Fail Whole Group</th>
- <td class="${repository.hardFail ? 'doneMark' : 'errorMark'}"></td>
- </tr>
-</table>
-</div>
-</c:forEach>
+ <ww:set name="proxiedRepositories" value="proxiedRepositories"/>
+ <c:if test="${empty(proxiedRepositories)}">
+ <strong>There are no proxied repositories configured yet.</strong>
+ </c:if>
+ <c:forEach items="${proxiedRepositories}" var="repository" varStatus="i">
+ <div>
+ <div style="float: right">
+ <%-- TODO replace with icons --%>
+ <a href="<ww:url action="editProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
+ Repository</a> | <a
+ href="<ww:url action="deleteProxiedRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Delete
+ Repository</a>
+ </div>
+ <h3>${repository.name}</h3>
+ <table>
+ <tr>
+ <th>Identifier</th>
+ <td>
+ <code>${repository.id}</code>
+ </td>
+ </tr>
+ <tr>
+ <th>URL</th>
+ <td><a href="${repository.url}">${repository.url}</a></td>
+ </tr>
+ <tr>
+ <th>Type</th>
+ <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%>
+ <td>
+ <c:choose>
+ <c:when test="${repository.layout == 'default'}">
+ Maven 2.x Repository
+ </c:when>
+ <c:otherwise>
+ Maven 1.x Repository
+ </c:otherwise>
+ </c:choose>
+ </td>
+ </tr>
+ <tr>
+ <th>Snapshots</th>
+ <td>
+ <my:displayUpdatePolicy policy="${repository.snapshotsPolicy}" interval="${repository.snapshotsInterval}"/>
+ </td>
+ </tr>
+ <tr>
+ <th>Releases</th>
+ <td>
+ <my:displayUpdatePolicy policy="${repository.releasesPolicy}" interval="${repository.releasesInterval}"/>
+ </td>
+ </tr>
+ <tr>
+ <th>Proxied through</th>
+ <td>
+ <%-- TODO: this is the hard way! would be nice if there was a ref in the model so it was directly linked --%>
+ ${repositoriesMap[repository.managedRepository].name}
+ (<code>${repositoriesMap[repository.managedRepository].id}</code>)
+ </td>
+ </tr>
+ <tr>
+ <th>Use HTTP Proxy</th>
+ <td class="${repository.useNetworkProxy ? 'doneMark' : 'errorMark'}"></td>
+ </tr>
+ <tr>
+ <th>Cache Failures</th>
+ <td class="${repository.cacheFailures ? 'doneMark' : 'errorMark'}"></td>
+ </tr>
+ <tr>
+ <th>Fail Whole Group</th>
+ <td class="${repository.hardFail ? 'doneMark' : 'errorMark'}"></td>
+ </tr>
+ </table>
+ </div>
+ </c:forEach>
-<p>
- <a href="<ww:url action="addProxiedRepository" method="input" />">Add Repository</a>
-</p>
+ <p>
+ <a href="<ww:url action="addProxiedRepository" method="input" />">Add Repository</a>
+ </p>
</div>
</body>
--%>
<div id="searchBox">
- <ww:form method="post" action="quickSearch" validate="true">
+ <ww:form method="get" action="quickSearch" validate="true">
<ww:textfield label="Search for" size="50" name="q"/>
<ww:submit label="Go!"/>
</ww:form>
--- /dev/null
+<%--
+ ~ Copyright 2005-2006 The Apache Software Foundation.
+ ~
+ ~ Licensed 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.
+ --%>
+
+<%-- TODO: this could perhaps just be a i18n call --%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ attribute name="policy" required="true" %>
+<%@ attribute name="interval" %>
+
+<c:choose>
+ <c:when test="${policy == 'disabled'}">
+ Disabled
+ </c:when>
+ <c:when test="${policy == 'always'}">
+ Updated every request
+ </c:when>
+ <c:when test="${policy == 'hourly'}">
+ Updated hourly
+ </c:when>
+ <c:when test="${policy == 'daily'}">
+ Updated daily
+ </c:when>
+ <c:when test="${policy == 'interval'}">
+ Updated every ${interval} minutes
+ </c:when>
+</c:choose>
\ No newline at end of file