You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2009/01/26 22:22:19 UTC
svn commit: r737860 - in
/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src:
main/java/org/apache/maven/mercury/ant/tasks/
main/resources/org/apache/maven/mercury/ant/tasks/
test/java/org/apache/maven/mercury/ant/tasks/
Author: hboutemy
Date: Mon Jan 26 21:22:19 2009
New Revision: 737860
URL: http://svn.apache.org/viewvc?rev=737860&view=rev
Log:
fixed some code formatting and typos
Added:
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MercuryAntTest.java
- copied, changed from r737835, maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MecuryAntTest.java
Removed:
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MecuryAntTest.java
Modified:
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractAntTask.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractDataType.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Auth.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Config.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dep.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dependency.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Repo.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ResolveTask.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/WriteTask.java
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/Messages.properties
maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/antlib.xml
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractAntTask.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractAntTask.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractAntTask.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractAntTask.java Mon Jan 26 21:22:19 2009
@@ -28,7 +28,9 @@
throws BuildException
{
if ( _failOnError )
+ {
throw new BuildException( msg );
+ }
}
// ----------------------------------------------------------------------------------------
@@ -46,14 +48,18 @@
Object so = project.getReference( configId );
if ( so == null )
+ {
throw new Exception( LANG.getMessage( "config.id.object.null", configId ) );
+ }
if ( !Config.class.isAssignableFrom( so.getClass() ) )
+ {
throw new Exception( LANG.getMessage( "config.id.object.wrong", configId, so.getClass().getName() ) );
+ }
config = (Config) so;
}
-
+
return config;
}
// ----------------------------------------------------------------------------------------
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractDataType.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractDataType.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractDataType.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/AbstractDataType.java Mon Jan 26 21:22:19 2009
@@ -13,12 +13,12 @@
extends ProjectComponent
{
private String id;
-
+
public String getId()
{
return id;
}
-
+
public void setId( String id )
{
this.id = id;
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Auth.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Auth.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Auth.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Auth.java Mon Jan 26 21:22:19 2009
@@ -18,10 +18,10 @@
extends AbstractDataType
{
private static final Language LANG = new DefaultLanguage( Auth.class );
-
- private static final String DEFAULT_AUTH_ID = System.getProperty( "mercury.default.auth.id"
- , "mercury.default.auth.id."+System.currentTimeMillis()
- );
+
+ private static final String DEFAULT_AUTH_ID =
+ System.getProperty( "mercury.default.auth.id", "mercury.default.auth.id." + System.currentTimeMillis() );
+
String _name;
String _pass;
@@ -72,14 +72,16 @@
{
setCertfile( certfile );
}
-
+
protected static Auth findAuth( Project project, String authId )
{
- Object ao = authId == null ? project.getReference( DEFAULT_AUTH_ID ) : project.getReference( authId );
+ Object ao = ( authId == null ) ? project.getReference( DEFAULT_AUTH_ID ) : project.getReference( authId );
if( ao == null )
+ {
return null;
-
+ }
+
return (Auth) ao;
}
@@ -91,7 +93,9 @@
{
File cf = new File( _certfile );
if ( !cf.exists() )
+ {
throw new BuildException( LANG.getMessage( "config.no.cert.file", _certfile ) );
+ }
try
{
@@ -103,7 +107,9 @@
}
}
else
+ {
cred = new Credentials( _name, _pass );
+ }
return cred;
}
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Config.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Config.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Config.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Config.java Mon Jan 26 21:22:19 2009
@@ -16,19 +16,19 @@
* @version $Id$
*/
public class Config
-extends AbstractDataType
+ extends AbstractDataType
{
private static final Language LANG = new DefaultLanguage( Config.class );
-
- public static final String DEFAULT_LOCAL_DIR = System.getProperty( "user.home" )+"/.m2/repository";
-
- public static final String DEFAULT_CENTRAL_URL = System.getProperty( "mercury.central.url", "http://repo1.maven.org/maven2" );
-
- public static final String DEFAULT_CONFIG_ID = System.getProperty( "mercury.default.config.id"
- , "mercury.default.config.id."+System.currentTimeMillis()
- );
-
- public static final String DEFAULT_PATH_ID = System.getProperty( "mercury.default.path.id", "mercury.path" );
+
+ public static final String DEFAULT_LOCAL_DIR = System.getProperty( "user.home" ) + "/.m2/repository";
+
+ public static final String DEFAULT_CENTRAL_URL =
+ System.getProperty( "mercury.central.url", "http://repo1.maven.org/maven2" );
+
+ public static final String DEFAULT_CONFIG_ID =
+ System.getProperty( "mercury.default.config.id", "mercury.default.config.id." + System.currentTimeMillis() );
+
+ public static final String DEFAULT_PATH_ID = System.getProperty( "mercury.default.path.id", "mercury.path" );
Collection<Repo> _repos;
@@ -39,50 +39,60 @@
public Config()
{
}
-
+
private Config( String localDir, String remoteUrl )
{
Repo local = createRepo();
local.setId( "defaultLocalRepo" );
- local.setDir( localDir == null ? DEFAULT_LOCAL_DIR : localDir );
-
+ local.setDir( ( localDir == null ) ? DEFAULT_LOCAL_DIR : localDir );
+
Repo central = createRepo();
central.setId( "central" );
- central.setUrl( remoteUrl == null ? DEFAULT_CENTRAL_URL : remoteUrl );
+ central.setUrl( ( remoteUrl == null ) ? DEFAULT_CENTRAL_URL : remoteUrl );
}
public List<Repository> getRepositories()
throws BuildException
{
if ( Util.isEmpty( _repos ) )
+ {
return null;
+ }
if ( _repositories != null )
+ {
return _repositories;
+ }
_repositories = new ArrayList<Repository>( _repos.size() );
for ( Repo repo : _repos )
+ {
_repositories.add( repo.getRepository() );
+ }
return _repositories;
}
-
+
private void init()
{
if( getId() != null )
+ {
return;
-
+ }
+
setId(DEFAULT_CONFIG_ID);
-
+
if( getProject() != null )
+ {
getProject().addReference( DEFAULT_CONFIG_ID, this );
+ }
}
public Repo createRepo()
{
init();
-
+
Repo r = new Repo(true);
listRepo( r );
@@ -98,48 +108,52 @@
protected void listRepo( Repo repo )
{
if ( _repos == null )
+ {
_repos = new ArrayList<Repo>( 4 );
+ }
_repos.add( repo );
}
-
+
public static void addDefaultRepository( Project project, Repo repo )
{
Object co = project.getReference( DEFAULT_CONFIG_ID );
- if( co == null )
+ if ( co == null )
{
co = new Config();
-
+
project.addReference( DEFAULT_CONFIG_ID, co );
}
-
+
Config config = (Config) co;
-
+
config.listRepo( repo );
}
-
+
public static Config getDefaultConfig( Project project )
{
Object co = project.getReference( DEFAULT_CONFIG_ID );
- if( co == null )
+ if ( co == null )
{
co = new Config( null, null );
-
+
project.addReference( DEFAULT_CONFIG_ID, co );
}
-
+
Config config = (Config) co;
-
+
return config;
}
public Auth createAuth()
{
init();
-
+
if ( _auths == null )
+ {
_auths = new ArrayList<Auth>( 4 );
+ }
Auth a = new Auth();
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dep.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dep.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dep.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dep.java Mon Jan 26 21:22:19 2009
@@ -36,65 +36,75 @@
* @version $Id$
*/
public class Dep
-extends AbstractDataType
-implements ResourceCollection
+ extends AbstractDataType
+ implements ResourceCollection
{
private static final Language LANG = new DefaultLanguage( Dep.class );
- private static final IMercuryLogger LOG = MercuryLoggerManager.getLogger( Dep.class );
+ private static final IMercuryLogger LOG = MercuryLoggerManager.getLogger( Dep.class );
private List<Dependency> _dependencies;
-
+
private List<Artifact> _artifacts;
-
+
private List<File> _files;
-
+
private String _configId;
-
+
private ArtifactScopeEnum _scope = ArtifactScopeEnum.compile;
private boolean _transitive = true;
-
+
private LocalRepositoryMap _pomRepo;
-
+
private Storage _pomStorage;
private List<ArtifactBasicMetadata> getDependencies( VirtualRepositoryReader vr )
- throws RepositoryException
+ throws RepositoryException
{
if ( Util.isEmpty( _dependencies ) )
+ {
return null;
+ }
List<ArtifactBasicMetadata> res = new ArrayList<ArtifactBasicMetadata>( _dependencies.size() );
-
+
for ( Dependency d : _dependencies )
{
- if( d._amd == null )
+ if ( d._amd == null )
+ {
throw new IllegalArgumentException( LANG.getMessage( "dep.dependency.name.mandatory" ) );
-
- if( Util.isEmpty( d._pom ))
+ }
+
+ if ( Util.isEmpty( d._pom ) )
+ {
res.add( d._amd );
+ }
else
{
String key = d._amd.getGAV();
-
+
ArtifactMetadata deps = null;
-
+
try
{
- _pomStorage.add( key, new File(d._pom) );
-
+ _pomStorage.add( key, new File( d._pom ) );
+
deps = vr.readDependencies( d._amd );
-
+
_pomStorage.removeRaw( key );
}
catch ( StorageException e )
{
- throw new RepositoryException(e);
+ throw new RepositoryException( e );
}
-
- if( deps != null && !Util.isEmpty( deps.getDependencies() ) )
- for( ArtifactBasicMetadata bmd : deps.getDependencies() )
+
+ if ( deps != null && !Util.isEmpty( deps.getDependencies() ) )
+ {
+ for ( ArtifactBasicMetadata bmd : deps.getDependencies() )
+ {
res.add( bmd );
+ }
+ }
}
}
@@ -104,7 +114,9 @@
public Dependency createDependency()
{
if ( _dependencies == null )
+ {
_dependencies = new ArrayList<Dependency>( 8 );
+ }
Dependency dep = new Dependency();
@@ -114,69 +126,83 @@
}
//----------------------------------------------------------------------------------------
protected List<Artifact> resolve()
- throws Exception
+ throws Exception
{
Config config = AbstractAntTask.findConfig( getProject(), _configId );
-
+
return resolve( config, _scope );
}
//----------------------------------------------------------------------------------------
protected List<Artifact> resolve( Config config, ArtifactScopeEnum scope )
- throws Exception
+ throws Exception
{
- if( ! Util.isEmpty(_artifacts) )
+ if ( !Util.isEmpty( _artifacts ) )
+ {
return _artifacts;
-
- if( Util.isEmpty( _dependencies ) )
+ }
+
+ if ( Util.isEmpty( _dependencies ) )
+ {
return null;
+ }
List<Repository> repos = config.getRepositories();
-
+
DependencyProcessor dp = new MavenDependencyProcessor();
-
+
_pomStorage = new DefaultStorage();
-
+
_pomRepo = new LocalRepositoryMap( "inMemMdRepo", dp, _pomStorage );
-
+
repos.add( 0, _pomRepo );
- DependencyBuilder db =
- DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL, repos );
+ DependencyBuilder db = DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL, repos );
VirtualRepositoryReader vr = new VirtualRepositoryReader( repos );
-
- List<ArtifactMetadata> res = db.resolveConflicts( scope, new ArtifactQueryList( getDependencies(vr) ), null, null );
+
+ List<ArtifactMetadata> res =
+ db.resolveConflicts( scope, new ArtifactQueryList( getDependencies( vr ) ), null, null );
if ( Util.isEmpty( res ) )
+ {
return null;
+ }
ArtifactResults aRes = vr.readArtifacts( res );
if ( aRes == null )
+ {
throw new BuildException( LANG.getMessage( "resolve.cannot.read", config.getId(), res.toString() ) );
+ }
- if ( aRes == null || aRes.hasExceptions() )
+ if ( ( aRes == null ) || aRes.hasExceptions() )
{
throw new Exception( LANG.getMessage( "vr.error", aRes.getExceptions().toString() ) );
}
if ( !aRes.hasResults() )
+ {
return null;
-
+ }
+
Map<ArtifactBasicMetadata, List<Artifact>> resMap = aRes.getResults();
-
+
int count = 0;
for ( ArtifactBasicMetadata key : resMap.keySet() )
{
List<Artifact> artifacts = resMap.get( key );
- if( artifacts != null )
+ if ( artifacts != null )
+ {
count += artifacts.size();
+ }
}
-
- if( count == 0 )
+
+ if ( count == 0 )
+ {
return null;
-
+ }
+
_artifacts = new ArrayList<Artifact>( count );
for ( ArtifactBasicMetadata key : resMap.keySet() )
@@ -184,8 +210,12 @@
List<Artifact> artifacts = resMap.get( key );
if ( !Util.isEmpty( artifacts ) )
+ {
for ( Artifact a : artifacts )
+ {
_artifacts.add( a );
+ }
+ }
}
return _artifacts;
@@ -217,29 +247,35 @@
return true;
}
//----------------------------------------------------------------------------------------
- public Iterator iterator()
+ public Iterator<File> iterator()
{
try
{
- if( _files != null )
+ if ( _files != null )
+ {
return _files.iterator();
-
+ }
+
List<Artifact> artifacts = resolve();
-
- if( Util.isEmpty( artifacts ) )
+
+ if ( Util.isEmpty( artifacts ) )
+ {
return null;
-
+ }
+
_files = new ArrayList<File>( artifacts.size() );
-
- for( Artifact a : _artifacts )
+
+ for ( Artifact a : _artifacts )
+ {
_files.add( a.getFile() );
-
+ }
+
return _files.iterator();
}
catch ( Exception e )
{
LOG.error( e.getMessage() );
-
+
return null;
}
}
@@ -249,16 +285,18 @@
try
{
List<Artifact> artifacts = resolve();
-
- if( Util.isEmpty( artifacts ) )
+
+ if ( Util.isEmpty( artifacts ) )
+ {
return 0;
-
+ }
+
return artifacts.size();
}
catch ( Exception e )
{
LOG.error( e.getMessage() );
-
+
return 0;
}
}
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dependency.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dependency.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dependency.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Dependency.java Mon Jan 26 21:22:19 2009
@@ -17,7 +17,7 @@
private static final Language LANG = new DefaultLanguage( Dependency.class );
ArtifactBasicMetadata _amd;
-
+
String _pom;
boolean _optional = false;
@@ -34,22 +34,28 @@
this._optional = optional;
if ( _amd != null )
+ {
_amd.setOptional( optional );
+ }
}
public void setPom( String pom )
{
this._pom = pom;
-
- if( _amd == null )
+
+ if ( _amd == null )
+ {
throw new UnsupportedOperationException( LANG.getMessage( "dep.dependency.pom.needs.name", pom ) );
+ }
}
public void setGroupId( String groupId )
{
- if( _amd == null )
+ if ( _amd == null )
+ {
_amd = new ArtifactBasicMetadata();
-
+ }
+
_amd.setGroupId( groupId );
}
@@ -60,9 +66,11 @@
public void setArtifactId( String artifactId )
{
- if( _amd == null )
+ if ( _amd == null )
+ {
_amd = new ArtifactBasicMetadata();
-
+ }
+
_amd.setArtifactId( artifactId );
}
@@ -73,9 +81,11 @@
public void setVersion( String version )
{
- if( _amd == null )
+ if ( _amd == null )
+ {
_amd = new ArtifactBasicMetadata();
-
+ }
+
_amd.setVersion( version );
}
}
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Repo.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Repo.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Repo.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/Repo.java Mon Jan 26 21:22:19 2009
@@ -4,7 +4,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -31,7 +30,7 @@
/**
* repository data type
- *
+ *
* @author Oleg Gusakov
* @version $Id$
*/
@@ -39,9 +38,9 @@
extends AbstractDataType
{
private static final Language LANG = new DefaultLanguage( Repo.class );
-
+
private static final String DEFAULT_LAYOUT = "default";
-
+
private String _dir;
private String _url;
@@ -78,60 +77,64 @@
{
_managed = managed;
}
-
+
private void processDefaults()
{
- if( _managed )
+ if ( _managed )
+ {
return;
-
- if( _registered )
+ }
+
+ if ( _registered )
+ {
return;
-
- if( getId() == null )
+ }
+
+ if ( getId() == null )
{
- String id = "random." + (int)(Math.random()*10000.) + ("."+System.nanoTime() ) ;
+ String id = "random." + (int) ( Math.random() * 10000. ) + ( "." + System.nanoTime() );
super.setId( id );
}
-
+
Config.addDefaultRepository( getProject(), this );
-
+
_registered = true;
}
-
+
@Override
public void setId( String id )
{
super.setId( id );
-
+
processDefaults();
}
public void setReadable( boolean readable )
{
this._readable = readable;
-
+
processDefaults();
}
public void setWriteable( boolean writeable )
{
this._writeable = writeable;
-
+
processDefaults();
}
public void setUrl( String url )
{
this._url = url;
-
+
processDefaults();
}
public void setDir( String dir )
{
this._dir = dir;
-
+
processDefaults();
}
@@ -144,41 +147,45 @@
public void setType( String type )
{
this._type = type;
-
+
processDefaults();
}
public void setAuthid( String authid )
{
this._authid = authid;
-
+
processDefaults();
}
public void setProxyauthid( String proxyauthid )
{
this._proxyauthid = proxyauthid;
-
+
processDefaults();
}
public void setLayout( String layout )
{
- if( !DEFAULT_LAYOUT.equals( layout ) )
+ if ( !DEFAULT_LAYOUT.equals( layout ) )
+ {
throw new IllegalArgumentException( LANG.getMessage( "repo.layout.not.supported", layout ) );
-
+ }
+
processDefaults();
}
boolean isLocal()
{
- return _dir != null;
+ return ( _dir != null );
}
public Verify createVerifywrite()
{
if ( _writeVerifiers == null )
+ {
_writeVerifiers = new ArrayList<Verify>( 2 );
+ }
Verify v = new Verify();
@@ -190,7 +197,9 @@
public Verify createVerifyread()
{
if ( _readVerifiers == null )
+ {
_readVerifiers = new ArrayList<Verify>( 2 );
+ }
Verify v = new Verify();
@@ -202,12 +211,16 @@
private Set<StreamVerifierFactory> getVerifiers( List<Verify> vlist )
{
if ( Util.isEmpty( vlist ) )
+ {
return null;
+ }
Set<StreamVerifierFactory> facs = new HashSet<StreamVerifierFactory>( vlist.size() );
for ( Verify v : vlist )
+ {
facs.add( v.getVerifierFactory() );
+ }
return facs;
@@ -252,10 +265,10 @@
{
throw new BuildException( e );
}
-
+
Auth au = null;
-
- if( _auth != null )
+
+ if ( _auth != null )
{
au = _auth;
}
@@ -264,19 +277,21 @@
au = Auth.findAuth( getProject(), _authid );
if ( au == null )
+ {
throw new BuildException( LANG.getMessage( "config.no.auth.for.id", _authid ) );
+ }
}
-
- if( au != null )
+
+ if ( au != null )
{
Credentials serverCred = au.createCredentials();
-
+
server.setServerCredentials( serverCred );
-
+
au = null;
}
-
- if( _proxyAuth != null )
+
+ if ( _proxyAuth != null )
{
au = _proxyAuth;
}
@@ -285,10 +300,12 @@
au = Auth.findAuth( getProject(), _proxyauthid );
if ( au == null )
+ {
throw new BuildException( LANG.getMessage( "config.no.proxy.auth.for.id", _proxyauthid ) );
+ }
}
-
- if( au != null )
+
+ if ( au != null )
{
Credentials proxyCred = au.createCredentials();
@@ -331,115 +348,125 @@
}
public class Verify
- extends AbstractDataType
-{
- public static final String PGP = "pgp";
+ extends AbstractDataType
+ {
+ public static final String PGP = "pgp";
- public static final String SHA1 = "sha1";
+ public static final String SHA1 = "sha1";
- String _type;
+ String _type;
- boolean _lenient = true;
+ boolean _lenient = true;
- boolean _sufficient = false;
+ boolean _sufficient = false;
- Map<String, String> _properties;
+ Map<String, String> _properties;
- public void setType( String type )
- {
- this._type = type;
- }
-
- public void setLenient( boolean lenient )
- {
- this._lenient = lenient;
- }
-
- public void setSufficient( boolean sufficient )
- {
- this._sufficient = sufficient;
- }
+ public void setType( String type )
+ {
+ this._type = type;
+ }
- public void addConfiguredProperty( Property property )
- {
- if ( _properties == null )
- _properties = new HashMap<String, String>( 4 );
+ public void setLenient( boolean lenient )
+ {
+ this._lenient = lenient;
+ }
- _properties.put( property.getName(), property.getValue() );
- }
+ public void setSufficient( boolean sufficient )
+ {
+ this._sufficient = sufficient;
+ }
- public StreamVerifierFactory getVerifierFactory()
- throws BuildException
- {
- if ( _type == null )
- throw new BuildException( LANG.getMessage( "config.repo.verifier.no.type" ) );
+ public void addConfiguredProperty( Property property )
+ {
+ if ( _properties == null )
+ {
+ _properties = new HashMap<String, String>( 4 );
+ }
- if ( _properties == null || _properties.isEmpty() )
- throw new BuildException( LANG.getMessage( "config.repo.verifier.no.properties", _type ) );
+ _properties.put( property.getName(), property.getValue() );
+ }
- if ( PGP.equals( _type ) )
+ public StreamVerifierFactory getVerifierFactory()
+ throws BuildException
{
- String keyRing = _properties.get( "keyring" );
-
- if ( keyRing == null )
- throw new BuildException( LANG.getMessage( "config.repo.verifier.pgp.no.keyring" ) );
+ if ( _type == null )
+ {
+ throw new BuildException( LANG.getMessage( "config.repo.verifier.no.type" ) );
+ }
- String pass = _properties.get( "pass" );
+ if ( ( _properties == null ) || _properties.isEmpty() )
+ {
+ throw new BuildException( LANG.getMessage( "config.repo.verifier.no.properties", _type ) );
+ }
- if ( pass == null ) // reader configuration
+ if ( PGP.equals( _type ) )
{
- try
- {
- PgpStreamVerifierFactory fac =
- new PgpStreamVerifierFactory(
- new StreamVerifierAttributes(
- PgpStreamVerifierFactory.DEFAULT_EXTENSION,
- _lenient, _sufficient ),
- FileUtil.toStream( keyRing ) );
- return fac;
- }
- catch ( Exception e )
+ String keyRing = _properties.get( "keyring" );
+
+ if ( keyRing == null )
{
- throw new BuildException( e );
+ throw new BuildException( LANG.getMessage( "config.repo.verifier.pgp.no.keyring" ) );
}
- }
- else
- // writer configuration
- {
- String keyId = _properties.get( "key" );
- if ( keyId == null || keyId.length() != 16 )
- throw new BuildException( LANG.getMessage( "config.repo.verifier.pgp.bad.keyid", keyId,
- keyRing ) );
+ String pass = _properties.get( "pass" );
- try
+ if ( pass == null ) // reader configuration
{
- PgpStreamVerifierFactory fac =
- new PgpStreamVerifierFactory(
- new StreamVerifierAttributes(
- PgpStreamVerifierFactory.DEFAULT_EXTENSION,
- _lenient, _sufficient ),
- FileUtil.toStream( keyRing ), keyId, pass );
- return fac;
+ try
+ {
+ PgpStreamVerifierFactory fac =
+ new PgpStreamVerifierFactory(
+ new StreamVerifierAttributes(
+ PgpStreamVerifierFactory.DEFAULT_EXTENSION,
+ _lenient, _sufficient ),
+ FileUtil.toStream( keyRing ) );
+ return fac;
+ }
+ catch ( Exception e )
+ {
+ throw new BuildException( e );
+ }
}
- catch ( Exception e )
+ else
+ // writer configuration
{
- throw new BuildException( e );
+ String keyId = _properties.get( "key" );
+
+ if ( ( keyId == null ) || ( keyId.length() != 16 ) )
+ {
+ throw new BuildException( LANG.getMessage( "config.repo.verifier.pgp.bad.keyid", keyId,
+ keyRing ) );
+ }
+
+ try
+ {
+ PgpStreamVerifierFactory fac =
+ new PgpStreamVerifierFactory(
+ new StreamVerifierAttributes(
+ PgpStreamVerifierFactory.DEFAULT_EXTENSION,
+ _lenient, _sufficient ),
+ FileUtil.toStream( keyRing ), keyId, pass );
+ return fac;
+ }
+ catch ( Exception e )
+ {
+ throw new BuildException( e );
+ }
+
}
+ }
+ else if ( SHA1.equals( _type ) )
+ {
+ SHA1VerifierFactory fac =
+ new SHA1VerifierFactory( new StreamVerifierAttributes( SHA1VerifierFactory.DEFAULT_EXTENSION,
+ _lenient, _sufficient ) );
+ return fac;
}
- }
- else if ( SHA1.equals( _type ) )
- {
- SHA1VerifierFactory fac =
- new SHA1VerifierFactory( new StreamVerifierAttributes( SHA1VerifierFactory.DEFAULT_EXTENSION,
- _lenient, _sufficient ) );
- return fac;
+ throw new BuildException( LANG.getMessage( "config.repo.verifier.bad.type", _type ) );
}
-
- throw new BuildException( LANG.getMessage( "config.repo.verifier.bad.type", _type ) );
}
-}
}
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ResolveTask.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ResolveTask.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ResolveTask.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/ResolveTask.java Mon Jan 26 21:22:19 2009
@@ -19,7 +19,7 @@
* @version $Id$
*/
public class ResolveTask
-extends AbstractAntTask
+ extends AbstractAntTask
{
private static final Language _lang = new DefaultLanguage( ResolveTask.class );
@@ -62,7 +62,7 @@
// Dependencies
Dep dep = null;
- if ( _depId == null && Util.isEmpty( _dependencies ) )
+ if ( ( _depId == null ) && Util.isEmpty( _dependencies ) )
{
throwIfEnabled( _lang.getMessage( "no.dep.id" ) );
return;
@@ -106,7 +106,7 @@
}
else if( !Util.isEmpty( _refPathId ) )
{
- Object p = getProject().getReference( _refPathId );
+ Object p = getProject().getReference( _refPathId );
if ( p == null )
{
@@ -117,16 +117,20 @@
path = (Path) p;
}
else
+ {
_pathId = Config.DEFAULT_PATH_ID;
+ }
try
{
Config config = AbstractAntTask.findConfig( getProject(), _configId );
-
+
Collection<Artifact> artifacts = dep.resolve( config, _scope );
if ( artifacts == null )
+ {
return;
+ }
FileList pathFileList = new FileList();
@@ -135,7 +139,9 @@
for ( Artifact a : artifacts )
{
if ( dir == null )
+ {
dir = a.getFile().getParentFile();
+ }
String aPath = a.getFile().getCanonicalPath();
@@ -170,9 +176,13 @@
catch ( Exception e )
{
if ( _failOnError )
+ {
throw new BuildException( e.getMessage() );
+ }
else
+ {
return;
+ }
}
}
@@ -240,12 +250,14 @@
public Dependency createDependency( )
{
if ( Util.isEmpty( _dependencies ) )
+ {
_dependencies = new ArrayList<Dependency>( 8 );
-
+ }
+
Dependency dependency = new Dependency();
_dependencies.add( dependency );
-
+
return dependency;
}
}
\ No newline at end of file
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/WriteTask.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/WriteTask.java?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/WriteTask.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/java/org/apache/maven/mercury/ant/tasks/WriteTask.java Mon Jan 26 21:22:19 2009
@@ -22,170 +22,190 @@
*
*/
public class WriteTask
-extends AbstractAntTask
+ extends AbstractAntTask
{
- private static final Language LANG = new DefaultLanguage( WriteTask.class );
-
- public static final String TASK_NAME = LANG.getMessage( "write.task.name" );
- public static final String TASK_DESC = LANG.getMessage( "write.task.desc" );
-
- private String _repoid;
- private String _file;
- private String _name;
- private String _pom;
- //----------------------------------------------------------------------------------------
- @Override
- public String getDescription()
- {
- return TASK_DESC;
- }
-
- @Override
- public String getTaskName()
- {
- return TASK_NAME;
- }
- //----------------------------------------------------------------------------------------
- private Repository findRepo()
- throws BuildException
- {
- Hashtable<String, Object> refs = getProject().getReferences();
-
- for( String key : refs.keySet() )
- {
- Object o = refs.get(key);
-
- if( o == null )
- continue;
-
- if( ! Config.class.isAssignableFrom( o.getClass() ) )
- continue;
-
- Config conf = (Config)o;
-
- Collection<Repository> repos = conf.getRepositories();
-
- if( Util.isEmpty( repos ) )
- continue;
-
- for( Repository r : repos )
- if( _repoid.equals( r.getId() ) )
- return r;
- }
-
- return null;
- }
- //----------------------------------------------------------------------------------------
- @Override
- public void execute()
- throws BuildException
- {
- if( _repoid == null )
- {
- throwIfEnabled( LANG.getMessage( "write.repo.id.mandatory" ) );
- return;
- }
-
- Repository repo = findRepo();
-
- if( repo == null )
- {
- throwIfEnabled( LANG.getMessage( "write.repo.not.found", _repoid ) );
- return;
- }
-
- if( _file == null )
- {
- throwIfEnabled( LANG.getMessage( "write.file.mandatory" ) );
- return;
- }
-
- File file = new File( _file );
-
- if( !file.exists() )
- {
- throwIfEnabled( LANG.getMessage( "write.file.not.found", _file, _repoid ) );
- return;
- }
-
- if( Util.isEmpty( _name ) && Util.isEmpty( _pom ) )
- {
- throwIfEnabled( LANG.getMessage( "write.no.name.no.pom", _file, _repoid ) );
- return;
- }
-
- if( !Util.isEmpty( _name ) && !Util.isEmpty( _pom ) )
- {
- throwIfEnabled( LANG.getMessage( "write.no.name.no.pom", _file, _repoid ) );
- return;
- }
-
- if( !Util.isEmpty( _pom ) )
- {
- throwIfEnabled( LANG.getMessage( "write.pom.not.supported", _file, _repoid ) );
- return;
- }
-
- try
- {
- DefaultArtifact a = null;
-
- if( !Util.isEmpty( _name ) )
- {
- a = new DefaultArtifact( new ArtifactBasicMetadata(_name) );
-
- String pomStr =
-"?xml version='1.0' encoding='UTF-8'?>\n"
-+"<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'>\n"
-+"<modelVersion>4.0.0</modelVersion>\n"
-+"<groupId>"+a.getGroupId()+"</groupId>\n"
-+"<artifactId>"+a.getArtifactId()+"</artifactId>\n"
-+ ( Util.isEmpty( a.getClassifier() ) ? "" : "<classifier>"+a.getClassifier()+"</classifier>\n" )
-+"<version>"+a.getVersion()+"</version>\n"
-+ ( Util.isEmpty( a.getType() ) ? "" : "<packaging>"+a.getType()+"</packaging>\n" )
-+"</project>\n"
- ;
-
- a.setPomBlob( pomStr.getBytes() );
-
- a.setFile( file );
-
- ArrayList<Artifact> al = new ArrayList<Artifact>(1);
- al.add( a );
-
- repo.getWriter().writeArtifacts( al );
- }
- else
- {
- throwIfEnabled( LANG.getMessage( "write.pom.not.supported", _file, _repoid ) );
- return;
- }
-
- }
- catch( Exception e )
- {
- throwIfEnabled( e.getMessage() );
- }
- }
-
- public void setRepoid( String repoid )
- {
- this._repoid = repoid;
- }
-
- public void setFile( String file )
- {
- this._file = file;
- }
-
- public void setName( String name )
- {
- this._name = name;
- }
-
- public void setPom( String pom )
- {
- this._pom = pom;
- }
-
+ private static final Language LANG = new DefaultLanguage( WriteTask.class );
+
+ public static final String TASK_NAME = LANG.getMessage( "write.task.name" );
+
+ public static final String TASK_DESC = LANG.getMessage( "write.task.desc" );
+
+ private String _repoid;
+
+ private String _file;
+
+ private String _name;
+
+ private String _pom;
+
+ // ----------------------------------------------------------------------------------------
+ @Override
+ public String getDescription()
+ {
+ return TASK_DESC;
+ }
+
+ @Override
+ public String getTaskName()
+ {
+ return TASK_NAME;
+ }
+
+ // ----------------------------------------------------------------------------------------
+ private Repository findRepo()
+ throws BuildException
+ {
+ Hashtable<String, Object> refs = getProject().getReferences();
+
+ for ( String key : refs.keySet() )
+ {
+ Object o = refs.get( key );
+
+ if ( o == null )
+ {
+ continue;
+ }
+
+ if ( !Config.class.isAssignableFrom( o.getClass() ) )
+ {
+ continue;
+ }
+
+ Config conf = (Config) o;
+
+ Collection<Repository> repos = conf.getRepositories();
+
+ if ( Util.isEmpty( repos ) )
+ {
+ continue;
+ }
+
+ for ( Repository r : repos )
+ {
+ if ( _repoid.equals( r.getId() ) )
+ {
+ return r;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ // ----------------------------------------------------------------------------------------
+ @Override
+ public void execute()
+ throws BuildException
+ {
+ if ( _repoid == null )
+ {
+ throwIfEnabled( LANG.getMessage( "write.repo.id.mandatory" ) );
+ return;
+ }
+
+ Repository repo = findRepo();
+
+ if ( repo == null )
+ {
+ throwIfEnabled( LANG.getMessage( "write.repo.not.found", _repoid ) );
+ return;
+ }
+
+ if ( _file == null )
+ {
+ throwIfEnabled( LANG.getMessage( "write.file.mandatory" ) );
+ return;
+ }
+
+ File file = new File( _file );
+
+ if ( !file.exists() )
+ {
+ throwIfEnabled( LANG.getMessage( "write.file.not.found", _file, _repoid ) );
+ return;
+ }
+
+ if ( Util.isEmpty( _name ) && Util.isEmpty( _pom ) )
+ {
+ throwIfEnabled( LANG.getMessage( "write.no.name.no.pom", _file, _repoid ) );
+ return;
+ }
+
+ if ( !Util.isEmpty( _name ) && !Util.isEmpty( _pom ) )
+ {
+ throwIfEnabled( LANG.getMessage( "write.no.name.no.pom", _file, _repoid ) );
+ return;
+ }
+
+ if ( !Util.isEmpty( _pom ) )
+ {
+ throwIfEnabled( LANG.getMessage( "write.pom.not.supported", _file, _repoid ) );
+ return;
+ }
+
+ try
+ {
+ DefaultArtifact a = null;
+
+ if ( !Util.isEmpty( _name ) )
+ {
+ a = new DefaultArtifact( new ArtifactBasicMetadata( _name ) );
+
+ String pomStr =
+ "?xml version='1.0' encoding='UTF-8'?>\n"
+ + "<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'>\n"
+ + "<modelVersion>4.0.0</modelVersion>\n"
+ + "<groupId>"
+ + a.getGroupId()
+ + "</groupId>\n"
+ + "<artifactId>"
+ + a.getArtifactId()
+ + "</artifactId>\n"
+ + ( Util.isEmpty( a.getClassifier() ) ? "" : "<classifier>" + a.getClassifier()
+ + "</classifier>\n" ) + "<version>" + a.getVersion() + "</version>\n"
+ + ( Util.isEmpty( a.getType() ) ? "" : "<packaging>" + a.getType() + "</packaging>\n" )
+ + "</project>\n";
+
+ a.setPomBlob( pomStr.getBytes() );
+
+ a.setFile( file );
+
+ ArrayList<Artifact> al = new ArrayList<Artifact>( 1 );
+ al.add( a );
+
+ repo.getWriter().writeArtifacts( al );
+ }
+ else
+ {
+ throwIfEnabled( LANG.getMessage( "write.pom.not.supported", _file, _repoid ) );
+ return;
+ }
+
+ }
+ catch ( Exception e )
+ {
+ throwIfEnabled( e.getMessage() );
+ }
+ }
+
+ public void setRepoid( String repoid )
+ {
+ this._repoid = repoid;
+ }
+
+ public void setFile( String file )
+ {
+ this._file = file;
+ }
+
+ public void setName( String name )
+ {
+ this._name = name;
+ }
+
+ public void setPom( String pom )
+ {
+ this._pom = pom;
+ }
+
}
\ No newline at end of file
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/Messages.properties
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/Messages.properties?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/Messages.properties (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/Messages.properties Mon Jan 26 21:22:19 2009
@@ -5,10 +5,10 @@
write.task.desc=this task writes a binary into specified repository
#=======================================================================================================
config.id.mandatory=configid attribute is mandatory, cannot create repositories without it
-config.id.object.null=object pointed by {0} is null
+config.id.object.null=object pointed by {0} is null
config.id.object.wrong=object pointed by {0} is of type {1} instead of mercury Config
no.path.ref=neither pathid nor refpathid are specified
-path.exists=path with id {0} already exists, cannot create
+path.exists=path with id {0} already exists, cannot create
no.path.ref=path with id {0} does not exist, cannot modify it
no.dep.id=no dependency id specified and no inner dependencies - don't know what to do
no.dep=no object with id {0} found
@@ -35,9 +35,9 @@
config.repo.verifier.no.type=Verifier configuration does not have type attribute - don't know what to do
config.repo.verifier.no.properties=Verifier configuration {0} does not have properties - don't know what to do
config.repo.verifier.pgp.no.keyring=PGP verifier configuration does not have a keyring property
-config.repo.verifier.bad.type=Verfier does not understand type {0}
+config.repo.verifier.bad.type=Verifier does not understand type {0}
config.repo.verifier.pgp.bad.keyid=Bad key "{0}" for secret keyring {1}; expected to see 16 hex number, but did not find them
-repo.no.id=repo {0} does not have an id attribute, or it's not the first attribute.
+repo.no.id=repo {0} does not have an id attribute, or it's not the first attribute.
repo.layout.not.supported=layout {0} is not supported
dep.pom.not.implemented=pom attribute not implemented for <dep ../> tag
Modified: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/antlib.xml
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/antlib.xml?rev=737860&r1=737859&r2=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/antlib.xml (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/main/resources/org/apache/maven/mercury/ant/tasks/antlib.xml Mon Jan 26 21:22:19 2009
@@ -5,25 +5,25 @@
<taskdef name="resolve" classname="org.apache.maven.mercury.ant.tasks.ResolveTask"/>
<taskdef name="write" classname="org.apache.maven.mercury.ant.tasks.WriteTask"/>
- <typedef name="deps" classname="org.apache.maven.mercury.ant.tasks.Dep"/>
+ <typedef name="deps" classname="org.apache.maven.mercury.ant.tasks.Dep"/>
<typedef name="repository" classname="org.apache.maven.mercury.ant.tasks.Repo"/>
<typedef name="config" classname="org.apache.maven.mercury.ant.tasks.Config"/>
<typedef name="repo" classname="org.apache.maven.mercury.ant.tasks.Repo"/>
<typedef name="repository" classname="org.apache.maven.mercury.ant.tasks.Repo"/>
-
- <!-- helper sytaxes -->
- <typedef name="dep" classname="org.apache.maven.mercury.ant.tasks.Dep"/>
+
+ <!-- helper syntaxes -->
+ <typedef name="dep" classname="org.apache.maven.mercury.ant.tasks.Dep"/>
<typedef name="dependencySet" classname="org.apache.maven.mercury.ant.tasks.Dep"/>
<typedef name="settings" classname="org.apache.maven.mercury.ant.tasks.Config"/>
<!-- do we need them as upper-level elements ?? -->
<typedef name="auth" classname="org.apache.maven.mercury.ant.tasks.Auth"/>
<typedef name="proxyauth" classname="org.apache.maven.mercury.ant.tasks.Auth"/>
-
- <!-- good old syntax -->
- <taskdef name="dependencies" classname="org.apache.maven.mercury.ant.tasks.ResolveTask"/>
+
+ <!-- good old syntax -->
+ <taskdef name="dependencies" classname="org.apache.maven.mercury.ant.tasks.ResolveTask"/>
<typedef name="localRepository" classname="org.apache.maven.mercury.ant.tasks.Repo"/>
<typedef name="remoteRepository" classname="org.apache.maven.mercury.ant.tasks.Repo"/>
-
+
</antlib>
Copied: maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MercuryAntTest.java (from r737835, maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MecuryAntTest.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MercuryAntTest.java?p2=maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MercuryAntTest.java&p1=maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MecuryAntTest.java&r1=737835&r2=737860&rev=737860&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MecuryAntTest.java (original)
+++ maven/mercury/trunk/mercury-ant/mercury-ant-tasks/src/test/java/org/apache/maven/mercury/ant/tasks/MercuryAntTest.java Mon Jan 26 21:22:19 2009
@@ -13,7 +13,7 @@
* @author Oleg Gusakov
* @version $Id$
*/
-public class MecuryAntTest
+public class MercuryAntTest
extends BuildFileTest
{
static final String _localRepoDir = "./target/repo";
@@ -88,7 +88,7 @@
}
// -----------------------------------
- public MecuryAntTest( String name )
+ public MercuryAntTest( String name )
{
super( name );
}
@@ -122,7 +122,7 @@
_jetty = new AuthenticatingTestServer( 0, _remoteRepoDirFile, _remoteRepoUrlSufix, false );
_jetty.start();
_port = _jetty.getPort();
-
+
Repo remoteRepo = _config.createRepo();
remoteRepo.setId( "remoteRepo" );
remoteRepo.setUrl( _remoteRepoUrlPrefix + _port + _remoteRepoUrlSufix );
@@ -157,7 +157,7 @@
_jarDirFile.mkdirs();
configureProject( "build.xml" );
- getProject().setProperty( "repo.port", ""+_port );
+ getProject().setProperty( "repo.port", "" + _port );
}
// -----------------------------------
@@ -165,10 +165,10 @@
throws Exception
{
tearDown();
-
+
_jetty = new AuthenticatingTestServer( port, localBase, remotePathFragment, secured );
_jetty.start();
-
+
this._port = port;
}
@@ -238,12 +238,12 @@
try
{
executeTarget( title );
-
- fail(title+" did not raise an exception");
+
+ fail( title + " did not raise an exception" );
}
catch( Throwable e )
{
- System.out.println("Expected exception: "+e.getMessage() );
+ System.out.println( "Expected exception: " + e.getMessage() );
}
assertFalse( af.exists() );
@@ -310,7 +310,7 @@
String title = "compile-thin-path-3";
System.out.println( "========> start " + title );
System.out.flush();
-
+
restart( _port, _remoteRepoDirFile, "/maven2", true );
File af = new File( _compileDirFile, "T.class" );
@@ -318,13 +318,13 @@
assertFalse( af.exists() );
File asm = new File( "target/path-3/asm/asm/3.0/asm-3.0.jar" );
-
+
FileUtil.delete( asm );
-
+
asm.delete();
assertFalse( asm.exists() );
-
+
executeTarget( title );
assertTrue( af.exists() );
@@ -353,7 +353,7 @@
asm.delete();
assertFalse( asm.exists() );
-
+
executeTarget( title );
assertTrue( af.exists() );
@@ -379,7 +379,7 @@
asm.delete();
assertFalse( asm.exists() );
-
+
executeTarget( title );
assertTrue( af.exists() );
@@ -407,7 +407,7 @@
asm.delete();
assertFalse( asm.exists() );
-
+
executeTarget( title );
assertTrue( af.exists() );
@@ -422,7 +422,7 @@
String title = "compile-auth";
System.out.println( "========> start " + title );
System.out.flush();
-
+
restart( _port, _remoteRepoDirFile, "/maven2", true );
try
@@ -511,12 +511,12 @@
try
{
executeTarget( "bad-pgp" );
-
+
fail( "reading bad pgp signature did not trigger an exception. Failing the test" );
}
catch ( Exception e )
{
- System.out.println("Expected exception: "+ e.getMessage() );
+ System.out.println( "Expected exception: " + e.getMessage() );
}
assertFalse( af.exists() );
@@ -554,7 +554,7 @@
FileUtil.delete( asm );
assertFalse( asm.exists() );
-
+
executeTarget( title );
assertTrue( af.exists() );