PR: MNG-1041

don't use active project if it is not the same dependency


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-10-03 03:51:48 +00:00
parent 990865bf99
commit cc96c2bc38
4 changed files with 40 additions and 5 deletions

View File

@ -1,5 +1,21 @@
package org.apache.maven.project;
/*
* Copyright 2001-2005 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.
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.model.Resource;
@ -10,7 +26,6 @@ import java.util.List;
public class DefaultMavenProjectHelper
implements MavenProjectHelper
{
// requirement.
private ArtifactFactory artifactFactory;

View File

@ -703,7 +703,7 @@ public class MavenProject
String type = artifact.getType();
// TODO: utilise type handler
return "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type );
return "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) || "test-jar".equals( type );
}
// ----------------------------------------------------------------------

View File

@ -1,11 +1,26 @@
package org.apache.maven.project;
/*
* Copyright 2001-2005 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.
*/
import java.io.File;
import java.util.List;
public interface MavenProjectHelper
{
{
String ROLE = MavenProjectHelper.class.getName();
void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, File artifactFile );

View File

@ -318,7 +318,12 @@ public class MavenMetadataSource
MavenProject project = (MavenProject) projectReferences.get( refId );
if ( project != null && project.getArtifact() != null )
{
artifact = new ActiveProjectArtifact( project, artifact );
// TODO: if not matching, we should get the correct artifact from that project (attached)
if ( project.getArtifact().getDependencyConflictId().equals(
artifact.getDependencyConflictId() ) )
{
artifact = new ActiveProjectArtifact( project, artifact );
}
}
}