mcconnell 2003/11/17 07:57:17
Modified: repository/api/src/java/org/apache/avalon/repository
MavenArtifactFactory.java RepositoryUtils.java
repository/main maven.xml
repository/main/src/java/org/apache/avalon/repository
InitialRepositoryFactory.java
repository maven.xml
Removed: repository project.properties
Log:
Sync. but things are not perfect.
Revision Changes Path
1.3 +26 -5
avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/MavenArtifactFactory.java
Index: MavenArtifactFactory.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/MavenArtifactFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MavenArtifactFactory.java 17 Nov 2003 13:23:02 -0000 1.2
+++ MavenArtifactFactory.java 17 Nov 2003 15:57:17 -0000 1.3
@@ -206,7 +206,12 @@
/**
- * @return group property of the supplied artifact.
+ * Return the group identifier for an artifact. This function
+ * is a convinience operation equivalent to
+ * <code>artifact.getProperty( GROUP_KEY );</code>. The value returned
+ * will be null if the group key is not defined.
+ *
+ * @return group id of the supplied artifact or null if not declared
*/
public static String getGroup( Artifact artifact )
{
@@ -214,7 +219,12 @@
}
/**
- * @return Returns the name.
+ * Return the name identifier for an artifact. This function
+ * is a convinience operation equivalent to
+ * <code>artifact.getProperty( NAME_KEY );</code>. The value returned
+ * will be null if the name key is not defined.
+ *
+ * @return group id of the supplied artifact or null if not declared
*/
public static String getName( Artifact artifact )
{
@@ -222,7 +232,12 @@
}
/**
- * @return Returns the name.
+ * Return the type identifier for an artifact. This function
+ * is a convinience operation equivalent to
+ * <code>artifact.getProperty( TYPE_KEY );</code>. The value returned
+ * will be null if the type key is not defined.
+ *
+ * @return group id of the supplied artifact or null if not declared
*/
public static String getType( Artifact artifact )
{
@@ -230,7 +245,12 @@
}
/**
- * @return Returns the version.
+ * Return the version identifier for an artifact. This function
+ * is a convinience operation equivalent to
+ * <code>artifact.getProperty( VERSION_KEY );</code>. The value returned
+ * will be null if the version key is not defined.
+ *
+ * @return group id of the supplied artifact or null if not declared
*/
public static String getVersion( Artifact artifact )
{
@@ -238,7 +258,8 @@
}
/**
- * Gets the artifact specification for this ArtifactDescriptor.
+ * Gets the artifact specification for this ArtifactDescriptor
+ * in the form <group>[:<name>][;<version>].
*
* @return the artifact specification
*/
1.6 +3 -2
avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/RepositoryUtils.java
Index: RepositoryUtils.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/RepositoryUtils.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RepositoryUtils.java 17 Nov 2003 08:14:35 -0000 1.5
+++ RepositoryUtils.java 17 Nov 2003 15:57:17 -0000 1.6
@@ -177,6 +177,7 @@
*/
public static Properties getProperties( URL a_url ) throws IOException
{
+System.out.println( "## GETTING PROPERTIES FOR URL: " + a_url );
InputStream l_in = null ;
Properties l_props = new Properties() ;
l_in = a_url.openStream() ;
1.2 +11 -2 avalon-sandbox/repository/main/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/repository/main/maven.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maven.xml 17 Nov 2003 08:18:46 -0000 1.1
+++ maven.xml 17 Nov 2003 15:57:17 -0000 1.2
@@ -16,6 +16,14 @@
<ant:mkdir dir="${maven.build.dir}/classes/${pom.groupId}"/>
<ant:echo
file="${maven.build.dir}/classes/${pom.groupId}/${pom.artifactId}.meta">
#
+# Meta classifier.
+#
+
+meta.domain = avalon
+meta.domain.classifier = target
+meta.domain.classifier.version = 1.0
+
+#
# Repository Implementation target description.
#
@@ -26,12 +34,13 @@
#
# Factory class and parameters.
+# (factory methof/constructor/parameters generation pending)
#
avalon.target.factory.class =
org.apache.avalon.repository.impl.DefaultRepositoryFactory
avalon.target.factory.method = create
-#avalon.target.factory.key.0 = some-key
-#avalon.target.factory.key.0 = another-key
+avalon.target.factory.key.0 = some-key
+avalon.target.factory.key.1 = another-key
#
# EOF
1.2 +19 -6
avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java
Index: InitialRepositoryFactory.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitialRepositoryFactory.java 17 Nov 2003 08:18:46 -0000 1.1
+++ InitialRepositoryFactory.java 17 Nov 2003 15:57:17 -0000 1.2
@@ -82,6 +82,9 @@
*/
public class InitialRepositoryFactory implements RepositoryFactory
{
+ public static final String AVALON_ARTIFACT_DEPENDENCY =
+ "avalon.artifact.dependency";
+
public static final String REPOSITORY_GROUP_NAME =
"avalon-repository" ;
public static final String REPOSITORY_APPLICATION_NAME =
@@ -262,7 +265,9 @@
// If the key that is supplied here is does not have a value we get
null
// back instead of an empty list
- NamingEnumeration l_list = l_attrs.get( "avalon.dependency" ).getAll() ;
+System.out.println("## LIST: " + l_attrs );
+
+ NamingEnumeration l_list = l_attrs.get( AVALON_ARTIFACT_DEPENDENCY
).getAll() ;
while ( l_list.hasMore() )
{
l_spec = ( String ) l_list.next() ;
@@ -310,7 +315,7 @@
catch ( Exception e )
{
final String error =
- "Unable to download dependent artifact[" + l_spec
+ "Unable to download dependent artifact [" + l_spec
+ "] for the implementation reference: [" + implementation + "].";
throw new RepositoryException( error, e ) ;
}
@@ -467,6 +472,8 @@
boolean l_updated = false ;
Exception l_cause = null ;
+System.out.println( "## CACHING ARTIFACT");
+
/*
* Don't fail fast - keep trying until we get something.
*/
@@ -508,8 +515,9 @@
* <code>destinationFile</code> against the remote <code>source</code>
* @return TRUE if the file was updated else FALSE
*/
- public static boolean getTempFile( String a_url, File a_destFile,
- boolean a_useTimestamp ) throws Exception
+ public static boolean getTempFile(
+ String a_url, File a_destFile, boolean a_useTimestamp )
+ throws Exception
{
URL l_source = null ;
String l_username = null ;
@@ -544,6 +552,9 @@
l_hasTimestamp = true ;
}
+System.out.println( "USING TIMESTAMP: " + l_timestamp );
+System.out.println( "HAS TIMESTAMP: " + l_hasTimestamp );
+
//set up the URL connection
URLConnection l_connection = l_source.openConnection() ;
@@ -551,6 +562,7 @@
//NB: things like user authentication could go in here too.
if ( a_useTimestamp && l_hasTimestamp )
{
+System.out.println( "SETTING IF MODIFIED" );
l_connection.setIfModifiedSince( l_timestamp ) ;
}
@@ -565,6 +577,7 @@
if ( l_httpConnection.getResponseCode() ==
HttpURLConnection.HTTP_NOT_MODIFIED )
{
+System.out.println( "NOT MODIFIED RESPONCE" );
return false ;
}
1.6 +8 -0 avalon-sandbox/repository/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/repository/maven.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- maven.xml 17 Nov 2003 08:46:07 -0000 1.5
+++ maven.xml 17 Nov 2003 15:57:17 -0000 1.6
@@ -27,4 +27,12 @@
<attainGoal name="avalon:artifact"/>
</preGoal>
+ <postGoal name="jar:install">
+ <ant:copy toDir="${maven.repo.local}/${pom.groupId}/jars">
+ <fileset dir="${maven.build.dir}">
+ <include name="*.meta"/>
+ </fileset>
+ </ant:copy>
+ </postGoal>
+
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]