Modified: maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Thu Jun 16 23:49:57 2005 @@ -18,6 +18,7 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.deployer.ArtifactDeployer; import org.apache.maven.artifact.deployer.ArtifactDeploymentException; import org.apache.maven.artifact.metadata.ArtifactMetadata; @@ -28,6 +29,8 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata; import java.io.File; +import java.util.Iterator; +import java.util.List; /** * Deploys an artifact to remote repository. @@ -111,6 +114,20 @@ private ArtifactRepository localRepository; /** + * @parameter expression="${project.attachedArtifacts} + * @required + * @readonly + */ + private List attachedArtifacts; + + /** + * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}" + * @required + * @readonly + */ + private ArtifactFactory artifactFactory; + + /** * @parameter expression="${updateReleaseInfo}" */ private boolean updateReleaseInfo = false; @@ -126,7 +143,9 @@ } // Deploy the POM - Artifact artifact = new DefaultArtifact( groupId, artifactId, version, packaging ); + // TODO: maybe not strictly correct, while we should enfore that packaging has a type handler of the same id, we don't + Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version, null, packaging ); + boolean isPomArtifact = "pom".equals( packaging ); File pom = new File( parentDir, "pom.xml" ); if ( !isPomArtifact ) @@ -152,7 +171,13 @@ { deployer.deploy( buildDirectory, finalName, artifact, deploymentRepository, localRepository ); } - } + + for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); ) + { + Artifact attached = (Artifact) i.next(); + deployer.deploy( attached.getFile(), attached, deploymentRepository, localRepository ); + } + } catch ( ArtifactDeploymentException e ) { // TODO: deployment exception that does not give a trace
Modified: maven/components/trunk/maven-plugins/maven-ejb-plugin/pom.xml URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ejb-plugin/pom.xml?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-ejb-plugin/pom.xml (original) +++ maven/components/trunk/maven-plugins/maven-ejb-plugin/pom.xml Thu Jun 16 23:49:57 2005 @@ -15,5 +15,10 @@ <artifactId>maven-archiver</artifactId> <version>2.0-alpha-2</version> </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> </dependencies> </model> Modified: maven/components/trunk/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Thu Jun 16 23:49:57 2005 @@ -18,6 +18,8 @@ import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; @@ -37,12 +39,10 @@ // TODO: will null work instead? private static final String[] DEFAULT_INCLUDES = new String[]{"**/**"}; - private static final String[] DEFAULT_EXCLUDES = new String[]{"**/*Bean.class", "**/*CMP.class", - "**/*Session.class", "**/package.html"}; + private static final String[] DEFAULT_EXCLUDES = new String[]{"**/*Bean.class", "**/*CMP.class", "**/*Session.class", "**/package.html"}; /** * @todo File instead - * * @parameter expression="${project.build.directory}" * @required * @readonly @@ -63,7 +63,6 @@ /** * @todo boolean instead - * * @parameter */ private String generateClient = Boolean.FALSE.toString(); @@ -76,6 +75,13 @@ private MavenProject project; /** + * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}" + * @required + * @readonly + */ + private ArtifactFactory artifactFactory; + + /** * @parameter */ private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); @@ -121,6 +127,14 @@ // create archive clientArchiver.createArchive( project, archive ); + + Artifact artifact = artifactFactory.createArtifactWithClassifier( project.getGroupId(), + project.getArtifactId(), + project.getVersion(), null, + "ejb-client", "client" ); + artifact.setFile( clientJarFile ); + + project.addAttachedArtifact( artifact ); } } catch ( Exception e ) Modified: maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java Thu Jun 16 23:49:57 2005 @@ -18,6 +18,7 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.plugin.MojoExecutionException; @@ -68,10 +69,18 @@ */ private File file; + /** + * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}" + * @required + * @readonly + */ + private ArtifactFactory artifactFactory; + public void execute() throws MojoExecutionException { - Artifact artifact = new DefaultArtifact( groupId, artifactId, version, packaging ); + // TODO: maybe not strictly correct, while we should enfore that packaging has a type handler of the same id, we don't + Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version, null, packaging ); try { Modified: maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java Thu Jun 16 23:49:57 2005 @@ -18,6 +18,7 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.metadata.ReleaseArtifactMetadata; @@ -25,6 +26,8 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata; import java.io.File; +import java.util.Iterator; +import java.util.List; /** * Installs project's main artifact in local repository. @@ -89,10 +92,25 @@ */ private boolean updateReleaseInfo = false; + /** + * @parameter expression="${project.attachedArtifacts} + * @required + * @readonly + */ + private List attachedArtifacts; + + /** + * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}" + * @required + * @readonly + */ + private ArtifactFactory artifactFactory; + public void execute() throws MojoExecutionException { - Artifact artifact = new DefaultArtifact( groupId, artifactId, version, packaging ); + // TODO: maybe not strictly correct, while we should enfore that packaging has a type handler of the same id, we don't + Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version, null, packaging ); boolean isPomArtifact = "pom".equals( packaging ); File pom = new File( basedir, "pom.xml" ); @@ -119,6 +137,12 @@ { // TODO: would be something nice to get back from the project to get the full filename (the OGNL feedback thing) installer.install( buildDirectory, finalName, artifact, localRepository ); + } + + for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); ) + { + Artifact attached = (Artifact) i.next(); + installer.install( attached.getFile(), attached, localRepository ); } } catch ( ArtifactInstallationException e ) Modified: maven/components/trunk/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java (original) +++ maven/components/trunk/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java Thu Jun 16 23:49:57 2005 @@ -16,9 +16,8 @@ * limitations under the License. */ -import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; @@ -117,6 +116,11 @@ */ private Properties systemProperties; + /** + * @parameter expression="${plugin.artifacts}" + */ + private List pluginArtifacts; + public void execute() throws MojoExecutionException { @@ -194,19 +198,10 @@ } } - // TODO: we should really just trust the plugin classloader? - try - { - DefaultArtifact artifact = new DefaultArtifact( "junit", "junit", "3.8.1", "jar" ); - File file = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) ); - surefireBooter.addClassPathUrl( file.getAbsolutePath() ); - artifact = new DefaultArtifact( "surefire", "surefire", "1.2", "jar" ); - file = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) ); - surefireBooter.addClassPathUrl( file.getAbsolutePath() ); - } - catch ( ArtifactPathFormatException e ) + for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); ) { - throw new MojoExecutionException( "Error finding surefire JAR", e ); + Artifact artifact = (Artifact) i.next(); + surefireBooter.addClassPathUrl( artifact.getFile().getAbsolutePath() ); } surefireBooter.addClassPathUrl( new File( classesDirectory ).getPath() ); Modified: maven/components/trunk/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java Thu Jun 16 23:49:57 2005 @@ -169,6 +169,7 @@ Artifact artifact = (Artifact) iter.next(); // TODO: scope handler + // TODO: use classpath instead // Include runtime and compile time libraries if ( "jar".equals( artifact.getType() ) && !Artifact.SCOPE_TEST.equals( artifact.getScope() ) && !Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) { Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original) +++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Thu Jun 16 23:49:57 2005 @@ -471,7 +471,7 @@ protected Set createArtifacts( List dependencies ) { // TODO: merge with MavenMetadataSource properly - return new MavenMetadataSource( artifactResolver, this ).createArtifacts( dependencies, null, null ); + return new MavenMetadataSource( artifactResolver, this, artifactFactory ).createArtifacts( dependencies, null, null ); } protected Set createPluginArtifacts( List plugins ) Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java (original) +++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java Thu Jun 16 23:49:57 2005 @@ -79,11 +79,13 @@ private Set pluginArtifacts; private List remoteArtifactRepositories; - + private Properties profileProperties = new Properties(); private List collectedProjects = Collections.EMPTY_LIST; + private List attachedArtifacts; + public MavenProject( Model model ) { this.model = model; @@ -266,12 +268,12 @@ public List getCompileDependencies() { Set artifacts = getArtifacts(); - - if(artifacts == null || artifacts.isEmpty()) + + if ( artifacts == null || artifacts.isEmpty() ) { return Collections.EMPTY_LIST; } - + List list = new ArrayList( artifacts.size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) @@ -309,8 +311,8 @@ if ( isAddedToClasspath( a ) ) { // TODO: let the scope handler deal with this - if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) - || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) + if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) || + Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { File file = a.getFile(); if ( file == null ) @@ -327,12 +329,12 @@ public List getTestDependencies() { Set artifacts = getArtifacts(); - - if(artifacts == null || artifacts.isEmpty()) + + if ( artifacts == null || artifacts.isEmpty() ) { return Collections.EMPTY_LIST; } - + List list = new ArrayList( artifacts.size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) @@ -340,8 +342,8 @@ Artifact a = (Artifact) i.next(); // TODO: let the scope handler deal with this - if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) - || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) + if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) || + Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { Dependency dependency = new Dependency(); @@ -388,12 +390,12 @@ public List getRuntimeDependencies() { Set artifacts = getArtifacts(); - - if(artifacts == null || artifacts.isEmpty()) + + if ( artifacts == null || artifacts.isEmpty() ) { return Collections.EMPTY_LIST; } - + List list = new ArrayList( artifacts.size() ); for ( Iterator i = artifacts.iterator(); i.hasNext(); ) @@ -422,7 +424,7 @@ String type = artifact.getType(); // TODO: utilise type handler - if ( "jar".equals( type ) || "ejb".equals( type ) ) + if ( "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) ) { return true; } @@ -715,6 +717,7 @@ return model.getReports().getPlugins(); } + public List getBuildPlugins() { if ( model.getBuild() == null ) @@ -785,13 +788,14 @@ { Artifact existing = (Artifact) artifacts.get( id ); boolean updateScope = false; - if ( Artifact.SCOPE_RUNTIME.equals( a.getScope() ) && Artifact.SCOPE_TEST.equals( existing.getScope() ) ) + if ( Artifact.SCOPE_RUNTIME.equals( a.getScope() ) && + Artifact.SCOPE_TEST.equals( existing.getScope() ) ) { updateScope = true; } - if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) - && !Artifact.SCOPE_COMPILE.equals( existing.getScope() ) ) + if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) && + !Artifact.SCOPE_COMPILE.equals( existing.getScope() ) ) { updateScope = true; } @@ -800,10 +804,9 @@ { // TODO: Artifact factory? // TODO: [jc] Is this a better way to centralize artifact construction here? - Artifact artifact = artifactFactory.createArtifact( existing.getGroupId(), - existing.getArtifactId(), + Artifact artifact = artifactFactory.createArtifact( existing.getGroupId(), existing.getArtifactId(), existing.getVersion(), a.getScope(), existing - .getType() ); + .getType() ); artifact.setFile( existing.getFile() ); artifact.setBaseVersion( existing.getBaseVersion() ); @@ -905,10 +908,23 @@ { this.activeProfiles.addAll( activeProfiles ); } - + public List getActiveProfiles() { return activeProfiles; } + public void addAttachedArtifact( Artifact artifact ) + { + getAttachedArtifacts().add( artifact ); + } + + public List getAttachedArtifacts() + { + if ( attachedArtifacts == null ) + { + attachedArtifacts = new ArrayList(); + } + return attachedArtifacts; + } } Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java (original) +++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java Thu Jun 16 23:49:57 2005 @@ -18,15 +18,14 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; -import org.apache.maven.artifact.factory.DefaultArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolver; +import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; -import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.model.Dependency; import org.apache.maven.model.Exclusion; import org.apache.maven.model.Model; @@ -58,24 +57,26 @@ private ArtifactResolver artifactResolver; - // TODO: configure? - protected ArtifactFactory artifactFactory = new DefaultArtifactFactory(); + private ArtifactFactory artifactFactory; /** * @todo remove. */ private MavenXpp3Reader reader = new MavenXpp3Reader(); - public MavenMetadataSource( ArtifactResolver artifactResolver ) + public MavenMetadataSource( ArtifactResolver artifactResolver, ArtifactFactory artifactFactory ) { this.artifactResolver = artifactResolver; this.mavenProjectBuilder = null; + this.artifactFactory = artifactFactory; } - public MavenMetadataSource( ArtifactResolver artifactResolver, MavenProjectBuilder projectBuilder ) + public MavenMetadataSource( ArtifactResolver artifactResolver, MavenProjectBuilder projectBuilder, + ArtifactFactory artifactFactory ) { this.artifactResolver = artifactResolver; this.mavenProjectBuilder = projectBuilder; + this.artifactFactory = artifactFactory; } public Set retrieve( Artifact artifact, ArtifactRepository localRepository, List remoteRepositories ) @@ -180,7 +181,7 @@ artifact.setDependencyFilter( dependencyFilter ); - projectArtifacts.add( artifact ); + projectArtifacts.add( artifact ); } } Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java (original) +++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java Thu Jun 16 23:49:57 2005 @@ -21,7 +21,6 @@ import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; import org.apache.maven.artifact.manager.WagonManager; import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; @@ -64,15 +63,7 @@ public void storeInLocalRepository( ArtifactRepository localRepository ) throws ArtifactMetadataRetrievalException { - File destination; - try - { - destination = new File( localRepository.getBasedir(), localRepository.pathOfMetadata( this ) ); - } - catch ( ArtifactPathFormatException e ) - { - throw new ArtifactMetadataRetrievalException( "Unable to install POM", e ); - } + File destination = new File( localRepository.getBasedir(), localRepository.pathOfMetadata( this ) ); destination.getParentFile().mkdirs(); Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/MavenProjectTestCase.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/MavenProjectTestCase.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/MavenProjectTestCase.java (original) +++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/MavenProjectTestCase.java Thu Jun 16 23:49:57 2005 @@ -18,6 +18,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.codehaus.plexus.PlexusTestCase; import java.io.File; @@ -34,12 +35,15 @@ { protected MavenProjectBuilder projectBuilder; + private ArtifactFactory artifactFactory; + protected void setUp() throws Exception { super.setUp(); projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ); + artifactFactory = ( ArtifactFactory ) lookup( ArtifactFactory.ROLE ); } // ---------------------------------------------------------------------- @@ -94,7 +98,7 @@ throws Exception { return projectBuilder.buildWithDependencies( pom, getLocalRepository(), - new ProjectClasspathArtifactResolver.Source(), + new ProjectClasspathArtifactResolver.Source( artifactFactory ), Collections.EMPTY_LIST ); } Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java (original) +++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java Thu Jun 16 23:49:57 2005 @@ -46,10 +46,11 @@ public static class Source implements ArtifactMetadataSource { - private ArtifactFactory artifactFactory = new DefaultArtifactFactory(); + private ArtifactFactory artifactFactory; - public Source() + public Source( ArtifactFactory artifactFactory ) { + this.artifactFactory = artifactFactory; } public Set retrieve( Artifact artifact, ArtifactRepository localRepository, List remoteRepositories ) @@ -111,7 +112,7 @@ ArtifactMetadataSource source, ArtifactFilter filter ) throws ArtifactResolutionException { - return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source(), filter ); + return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source( artifactFactory ), filter ); } public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteRepositories, @@ -119,7 +120,7 @@ ArtifactMetadataSource source ) throws ArtifactResolutionException { - return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source() ); + return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source( artifactFactory ) ); } public ArtifactResolutionResult resolveTransitively( Artifact artifact, List remoteRepositories, @@ -127,6 +128,6 @@ ArtifactMetadataSource source ) throws ArtifactResolutionException { - return super.resolveTransitively( artifact, remoteRepositories, localRepository, new Source() ); + return super.resolveTransitively( artifact, remoteRepositories, localRepository, new Source( artifactFactory ) ); } } Modified: maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml?rev=191096&r1=191095&r2=191096&view=diff ============================================================================== --- maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml (original) +++ maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml Thu Jun 16 23:49:57 2005 @@ -9,9 +9,6 @@ <role>org.apache.maven.artifact.manager.WagonManager</role> </requirement> <requirement> - <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role> - </requirement> - <requirement> <role>org.apache.maven.artifact.factory.ArtifactFactory</role> </requirement> </requirements> @@ -23,9 +20,6 @@ <requirements> <requirement> <role>org.apache.maven.artifact.manager.WagonManager</role> - </requirement> - <requirement> - <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role> </requirement> <requirement> <role>org.apache.maven.artifact.factory.ArtifactFactory</role> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
