Author: snicoll
Date: Fri Nov 3 20:58:36 2006
New Revision: 471117
URL: http://svn.apache.org/viewvc?view=rev&rev=471117
Log:
MEAR-44: Classifier can be used with Ear modules
Submitted by: Cédric Vidal
Reviewed by: Stephane Nicoll
Added:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
(with props)
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.java
- copied, changed from r470010,
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ArtifactTypeMappingService.java
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.java
- copied, changed from r470010,
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTypeMappingServiceTest.java
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
(with props)
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
(with props)
Removed:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ArtifactTypeMappingService.java
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTypeMappingServiceTest.java
Modified:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
Modified:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
Fri Nov 3 20:58:36 2006
@@ -18,8 +18,8 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.ear.util.ArtifactRepository;
-import java.util.Iterator;
import java.util.Set;
/**
@@ -44,6 +44,8 @@
private String artifactId;
+ private String classifier;
+
protected String bundleDir;
protected String bundleFileName;
@@ -70,6 +72,7 @@
this.artifact = a;
this.groupId = a.getGroupId();
this.artifactId = a.getArtifactId();
+ this.classifier = a.getClassifier();
this.bundleDir = null;
}
@@ -85,23 +88,22 @@
throw new MojoFailureException(
"Could not resolve artifact[" + groupId + ":" + artifactId
+ ":" + getType() + "]" );
}
-
- Iterator i = artifacts.iterator();
- while ( i.hasNext() )
+ ArtifactRepository ar = new ArtifactRepository( artifacts );
+ artifact = ar.getUniqueArtifact( groupId, artifactId, getType(),
classifier );
+ // Artifact has not been found
+ if ( artifact == null )
{
- Artifact a = (Artifact) i.next();
-
- // If the groupId, the artifactId, the classifier matches and
if the
- // artifact's type is known, then we have found it.
- if ( a.getGroupId().equals( groupId ) &&
a.getArtifactId().equals( artifactId ) &&
- ArtifactTypeMappingService.getInstance().isMappedToType(
getType(), a.getType() ) )
+ Set candidates = ar.getArtifacts( groupId, artifactId,
getType() );
+ if ( candidates.size() > 1 )
{
- artifact = a;
- return;
+ throw new MojoFailureException( "Artifact[" + this + "]
has " + candidates.size() +
+ " candidates, please provide a classifier." );
+ }
+ else
+ {
+ throw new MojoFailureException( "Artifact[" + this + "] "
+ "is not a dependency of the project." );
}
}
- // Artifact has not been found
- throw new MojoFailureException( "Artifact[" + this + "] " + "is
not a dependency of the project." );
}
else
{
@@ -151,6 +153,16 @@
}
/**
+ * Returns the artifact's classifier.
+ *
+ * @return the artifact classifier
+ */
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
* Returns the bundle directory. If null, the module
* is bundled in the root of the EAR.
*
@@ -199,6 +211,10 @@
{
StringBuffer sb = new StringBuffer();
sb.append( getType() ).append( ":" ).append( groupId ).append( ":"
).append( artifactId );
+ if ( classifier != null )
+ {
+ sb.append( ":" ).append( classifier );
+ }
if ( artifact != null )
{
sb.append( ":" ).append( artifact.getVersion() );
@@ -236,5 +252,24 @@
}
return bundleDir;
+ }
+
+ /**
+ * Specify if the objects are both null or both equal.
+ *
+ * @param first the first object
+ * @param second the second object
+ * @return true if parameters are either both null or equal
+ */
+ static boolean areNullOrEqual( Object first, Object second )
+ {
+ if ( first != null )
+ {
+ return first.equals( second );
+ }
+ else
+ {
+ return second == null;
+ }
}
}
Modified:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
Fri Nov 3 20:58:36 2006
@@ -21,6 +21,7 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
Modified:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
Fri Nov 3 20:58:36 2006
@@ -17,6 +17,7 @@
*/
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService;
import java.util.ArrayList;
import java.util.List;
Added:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,132 @@
+package org.apache.maven.plugin.ear.util;
+
+import org.apache.maven.artifact.Artifact;
+
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+/*
+ * 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.
+ */
+
+/**
+ * An artifact repository used to resolve [EMAIL PROTECTED]
org.apache.maven.plugin.ear.EarModule}.
+ *
+ * @author <a href="[EMAIL PROTECTED]">Stephane Nicoll</a>
+ * @version $Id$
+ */
+public class ArtifactRepository
+{
+ private final Set artifacts;
+
+ private final ArtifactTypeMappingService artifactTypeMappingService;
+
+ /**
+ * Creates a new repository wih the specified artifacts.
+ *
+ * @param artifacts the artifacts
+ */
+ public ArtifactRepository( Set artifacts )
+ {
+ this.artifacts = artifacts;
+ this.artifactTypeMappingService =
ArtifactTypeMappingService.getInstance();
+ }
+
+ /**
+ * Returns the artifact with the specified parameters.
+ * <p/>
+ * If the artifact is classified and is the only one with the specified
+ * groupI, artifactId and type, it will be returned.
+ * <p/>
+ * If the artifact is classified and is not the only one with the specified
+ * groupI, artifactId and type, it returns null.
+ * <p/>
+ * If the artifact is not found, it returns null.
+ *
+ * @param groupId the group id
+ * @param artifactId the artifact id
+ * @param type the type
+ * @return the artifact or null if no artifact were found
+ */
+ public Artifact getUniqueArtifact( String groupId, String artifactId,
String type, String classifier )
+ {
+ final Set candidates = getArtifacts( groupId, artifactId, type);
+ if (candidates.size() == 0) {
+ return null;
+ } else if (candidates.size() == 1 && classifier == null) {
+ return (Artifact) candidates.iterator().next();
+ } else if (classifier != null) {
+ final Iterator it = candidates.iterator();
+ while (it.hasNext()) {
+ Artifact a = (Artifact) it.next();
+ if (classifier.equals( a.getClassifier())) {
+ return a;
+ }
+ }
+ }
+ // All other cases, classifier is null and more than one candidate ;
artifact not found
+ return null;
+ }
+
+ /**
+ * Returns the artifact with the specified parameters.
+ * <p/>
+ * If the artifact is classified and is the only one with the specified
+ * groupI, artifactId and type, it will be returned.
+ * <p/>
+ * If the artifact is classified and is not the only one with the specified
+ * groupI, artifactId and type, it returns null.
+ * <p/>
+ * If the artifact is not found, it returns null.
+ *
+ * @param groupId the group id
+ * @param artifactId the artifact id
+ * @param type the type
+ * @return the artifact or null if no artifact were found
+ */
+ public Artifact getUniqueArtifact( String groupId, String artifactId,
String type )
+ {
+ return getUniqueArtifact( groupId, artifactId, type, null);
+ }
+
+ /**
+ * Returns the artifacts with the specified parameters.
+ *
+ * @param groupId the group id
+ * @param artifactId the artifact id
+ * @param type the type
+ * @return the artifacts or an empty set if no artifact were found
+ */
+ public Set getArtifacts( String groupId, String artifactId, String type )
+ {
+ final Set result = new TreeSet();
+ final Iterator it = artifacts.iterator();
+ while ( it.hasNext() )
+ {
+ Artifact a = (Artifact) it.next();
+
+ // If the groupId, the artifactId and if the
+ // artifact's type is known, then we have found a candidate.
+ if ( a.getGroupId().equals( groupId ) && a.getArtifactId().equals(
artifactId ) &&
+ artifactTypeMappingService.isMappedToType( type, a.getType() )
)
+ {
+ result.add( a );
+
+ }
+ }
+ return result;
+ }
+}
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied:
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.java
(from r470010,
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ArtifactTypeMappingService.java)
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.java?view=diff&rev=471117&p1=maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ArtifactTypeMappingService.java&r1=470010&p2=maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.java&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ArtifactTypeMappingService.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.java
Fri Nov 3 20:58:36 2006
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.ear;
+package org.apache.maven.plugin.ear.util;
/*
* Copyright 2001-2005 The Apache Software Foundation.
@@ -18,6 +18,9 @@
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
+import org.apache.maven.plugin.ear.EarPluginException;
+import org.apache.maven.plugin.ear.EarModuleFactory;
+import org.apache.maven.plugin.ear.UnknownArtifactTypeException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -31,7 +34,7 @@
* @author <a href="[EMAIL PROTECTED]">Stephane Nicoll</a>
* @version $Id: EarModule.java 332974 2005-11-13 12:42:44Z snicoll $
*/
-class ArtifactTypeMappingService
+public class ArtifactTypeMappingService
{
static final String ARTIFACT_TYPE_MAPPING_ELEMENT = "artifactTypeMapping";
Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/modules.apt Fri Nov 3
20:58:36 2006
@@ -88,6 +88,9 @@
* <<artifactId>> - sets the artifactId of the ejb3 artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the ejb3 artifact you want to
+ configure if multiple ejb3 artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -114,6 +117,9 @@
* <<artifactId>> - sets the artifactId of the ejb-client artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the ejb-client artifact you want to
+ configure if multiple ejb-client artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -140,6 +146,9 @@
* <<artifactId>> - sets the artifactId of the ejb artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the ejb artifact you want to
+ configure if multiple ejb artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -166,6 +175,9 @@
* <<artifactId>> - sets the artifactId of the java artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the java artifact you want to
+ configure if multiple java artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -195,6 +207,9 @@
* <<artifactId>> - sets the artifactId of the par artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the par artifact you want to
+ configure if multiple par artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -221,6 +236,9 @@
* <<artifactId>> - sets the artifactId of the rar artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the rar artifact you want to
+ configure if multiple rar artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -247,6 +265,9 @@
* <<artifactId>> - sets the artifactId of the sar artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the sar artifact you want to
+ configure if multiple sar artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -273,6 +294,9 @@
* <<artifactId>> - sets the artifactId of the web artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the web artifact you want to
+ configure if multiple web artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -301,6 +325,9 @@
* <<artifactId>> - sets the artifactId of the wsr artifact you want to
configure.
+ * <<classifier>> - sets the classifier of the wst artifact you want to
+ configure if multiple wsr artifacts matches the groupId/artifact.
+
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
@@ -326,6 +353,10 @@
* <<artifactId>> - sets the artifactId of the hibernate archive artifact
you want to configure.
+
+ * <<classifier>> - sets the classifier of the hibernate archive artifact
+ you want to configure if multiple hibernate archive artifacts matches
+ the groupId/artifact.
* <<bundleDir>> - sets the location of this artifact inside the ear archive.
If not set, this artifact will be packaged in the root of the archive.
Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt Fri Nov 3
20:58:36 2006
@@ -72,4 +72,16 @@
* project-021: builds an EAR with unpacked archives using both unpackTypes
and the unpack module attribute
+ * project-022: builds an EAR with a classifier
+
+ * project-023: builds an EAR and make sure that a single classified
dependency is detected without specifying the classifier
+
+ * project-024: builds an EAR and make sure that a single classified
dependency is detected when specifying the classifier
+
+ * project-025: builds an EAR and make sure that a classified dependency with
mutiple candidates is detected when specifying the classifier
+
+ * project-026: builds an EAR and make sure that the build fails if a
unclassifed module configuration with mutiple candidates is specified.
+
+
+
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,342 @@
+package org.apache.maven.plugin.ear;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
+import org.apache.maven.artifact.versioning.VersionRange;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+
+/*
+ * 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.
+ */
+
+/**
+ * A fake [EMAIL PROTECTED] Artifact} test stub.
+ *
+ * @author <a href="[EMAIL PROTECTED]">Stephane Nicoll</a>
+ * @version $Id$
+ */
+public class ArtifactTestStub
+ implements Artifact
+
+{
+ private final String groupId;
+
+ private final String artifactId;
+
+ private final String type;
+
+ private final String classifier;
+
+
+ public ArtifactTestStub( String groupId, String artifactId, String type,
String classifier )
+ {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.type = type;
+ this.classifier = classifier;
+ }
+
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ public String getVersion()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setVersion( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getScope()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ public boolean hasClassifier()
+ {
+ return classifier != null;
+ }
+
+ public File getFile()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setFile( File file )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getBaseVersion()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setBaseVersion( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getId()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getDependencyConflictId()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void addMetadata( ArtifactMetadata artifactMetadata )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public Collection getMetadataList()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setRepository( ArtifactRepository artifactRepository )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public ArtifactRepository getRepository()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void updateVersion( String string, ArtifactRepository
artifactRepository )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public String getDownloadUrl()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setDownloadUrl( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public ArtifactFilter getDependencyFilter()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setDependencyFilter( ArtifactFilter artifactFilter )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public ArtifactHandler getArtifactHandler()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public List getDependencyTrail()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setDependencyTrail( List list )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setScope( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public VersionRange getVersionRange()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setVersionRange( VersionRange versionRange )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void selectVersion( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setGroupId( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setArtifactId( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public boolean isSnapshot()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setResolved( boolean b )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public boolean isResolved()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setResolvedVersion( String string )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setArtifactHandler( ArtifactHandler artifactHandler )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public boolean isRelease()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setRelease( boolean b )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public List getAvailableVersions()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setAvailableVersions( List list )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public boolean isOptional()
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public void setOptional( boolean b )
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public ArtifactVersion getSelectedVersion()
+ throws OverConstrainedVersionException
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public boolean isSelectedVersionKnown()
+ throws OverConstrainedVersionException
+ {
+ throw new UnsupportedOperationException( "not implemented ; fake
artifact stub" );
+ }
+
+ public int compareTo( Object o )
+ {
+ if ( this.equals( o ) )
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() )
+ {
+ return false;
+ }
+
+ ArtifactTestStub that = (ArtifactTestStub) o;
+
+ if ( artifactId != null ? !artifactId.equals( that.artifactId ) :
that.artifactId != null )
+ {
+ return false;
+ }
+ if ( classifier != null ? !classifier.equals( that.classifier ) :
that.classifier != null )
+ {
+ return false;
+ }
+ if ( groupId != null ? !groupId.equals( that.groupId ) : that.groupId
!= null )
+ {
+ return false;
+ }
+ if ( type != null ? !type.equals( that.type ) : that.type != null )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = ( groupId != null ? groupId.hashCode() : 0 );
+ result = 31 * result + ( artifactId != null ? artifactId.hashCode() :
0 );
+ result = 31 * result + ( type != null ? type.hashCode() : 0 );
+ result = 31 * result + ( classifier != null ? classifier.hashCode() :
0 );
+ return result;
+ }
+}
+
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java?view=diff&rev=471117&r1=471116&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EarMojoTest.java
Fri Nov 3 20:58:36 2006
@@ -247,4 +247,45 @@
assertTrue( "EAR archive not found", expectedFile.exists() );
}
+ /**
+ * Builds an EAR and make sure that a single classified dependency is
detected without specifying the classifier.
+ */
+ public void testProject023()
+ throws Exception
+ {
+ doTestProject( "project-023", new
String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-two-1.0.jar"},
+ new boolean[]{true, false} );
+ }
+
+ /**
+ * Builds an EAR and make sure that a single classified dependency is
detected when specifying the classifier.
+ */
+ public void testProject024()
+ throws Exception
+ {
+ doTestProject( "project-024", new
String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-two-1.0.jar"},
+ new boolean[]{true, false} );
+ }
+
+ /**
+ * Builds an EAR and make sure that a classified dependency with mutiple
candidates is detected when specifying the classifier.
+ */
+ public void testProject025()
+ throws Exception
+ {
+ doTestProject( "project-025", new
String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-one-1.0.jar"},
+ new boolean[]{true, false} );
+ }
+
+ /**
+ * Builds an EAR and make sure that the build fails if a unclassifed
module configuration with mutiple candidates is specified.
+ */
+ public void testProject026()
+ throws Exception
+ {
+ final File baseDir = executeMojo( "project-026", new Properties( ),
false);
+ // Stupido, checks that the ear archive is not there
+ assertFalse("Execution should have failed", getEarArchive(baseDir,
"project-026").exists());
+ }
+
}
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,129 @@
+package org.apache.maven.plugin.ear.util;
+
+import junit.framework.TestCase;
+import org.apache.maven.plugin.ear.ArtifactTestStub;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="[EMAIL PROTECTED]">Stephane Nicoll</a>
+ * @version $Id$
+ */
+public class ArtifactRepositoryTest
+ extends TestCase
+{
+
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+ ArtifactTypeMappingService.getInstance().configure( null);
+ }
+
+ public static final String DEFAULT_GROUPID = "eartest";
+
+ public static final String DEFAULT_TYPE = "jar";
+
+ public void testEmptyRepository()
+ {
+ ArtifactRepository repo = new ArtifactRepository( createArtifacts(
null ) );
+ assertNull( repo.getUniqueArtifact( "ear", "ar", "jar" ) );
+ assertNull( repo.getUniqueArtifact( "ear", "ar", "jar", null ) );
+ assertNull( repo.getUniqueArtifact( "ear", "ar", "jar", "class" ) );
+ }
+
+ public void testRepositoryWithOneUnclassifiedArtifact()
+ {
+ ArtifactRepository repo = new ArtifactRepository( createArtifacts( new
String[]{"myartifact"} ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar" ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", null ) );
+ }
+
+ public void testRepositoryWithOneClassifiedArtifact()
+ {
+ ArtifactRepository repo = new ArtifactRepository( createArtifacts( new
String[]{"myartifact"}, null, null, new String[]{"classified"} ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar" ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "classified" ) );
+ assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "wrong" ) );
+ }
+
+ public void testRepositoryWithMultipleClassifiedArtifacts()
+ {
+ ArtifactRepository repo = new ArtifactRepository( createArtifacts( new
String[]{"myartifact", "myartifact",
+ "myartifact"}, null, null, new String[]{"class1", "class2",
"class3"} ) );
+
+ assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar" ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "class1" ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "class2" ) );
+ assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "class3" ) );
+ assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact",
"jar", "wrong" ) );
+ }
+
+
+ private Set createArtifacts( String[] artifactsId )
+ {
+ return createArtifacts( artifactsId, null );
+ }
+
+ private Set createArtifacts( String[] artifactsId, String[] types )
+ {
+ return createArtifacts( artifactsId, types, null );
+ }
+
+ private Set createArtifacts( String[] artifactsId, String[] types,
String[] groupsId )
+ {
+ return createArtifacts( artifactsId, types, groupsId, null );
+ }
+
+ private Set createArtifacts( String[] artifactsId, String[] types,
String[] groupsId, String[] classifiers )
+ {
+ Set result = new TreeSet();
+ if ( artifactsId == null || artifactsId.length == 0 )
+ {
+ return result;
+ }
+ for ( int i = 0; i < artifactsId.length; i++ )
+ {
+ String artifactId = artifactsId[i];
+ String type = getData( types, i, DEFAULT_TYPE );
+ String groupId = getData( groupsId, i, DEFAULT_GROUPID );
+ String classifier = getData( classifiers, i, null );
+ result.add( new ArtifactTestStub( groupId, artifactId, type,
classifier ) );
+
+ }
+ return result;
+ }
+
+ private String getData( String[] data, int i, String defaultValue )
+ {
+ if ( data == null || data[i] == null )
+ {
+ return defaultValue;
+ }
+ else
+ {
+ return data[i];
+
+ }
+ }
+
+
+}
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied:
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.java
(from r470010,
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTypeMappingServiceTest.java)
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.java?view=diff&rev=471117&p1=maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTypeMappingServiceTest.java&r1=470010&p2=maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.java&r2=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/ArtifactTypeMappingServiceTest.java
(original)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.java
Fri Nov 3 20:58:36 2006
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.ear;
+package org.apache.maven.plugin.ear.util;
/*
* Copyright 2001-2005 The Apache Software Foundation.
@@ -19,6 +19,10 @@
import junit.framework.TestCase;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
+import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService;
+import org.apache.maven.plugin.ear.EarModuleFactory;
+import org.apache.maven.plugin.ear.UnknownArtifactTypeException;
+import org.apache.maven.plugin.ear.EarPluginException;
import java.util.Iterator;
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+ <display-name>maven-ear-plugin-test-project-023</display-name>
+ <module>
+ <ejb>ejb-sample-one-1.0-classified.jar</ejb>
+ </module>
+ <module>
+ <ejb>ejb-sample-two-1.0.jar</ejb>
+ </module>
+</application>
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-023</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ <classifier>classified</classifier>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-two</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <modules>
+ <ejbModule>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <unpack>true</unpack>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-023/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+ <display-name>maven-ear-plugin-test-project-024</display-name>
+ <module>
+ <ejb>ejb-sample-one-1.0-classified.jar</ejb>
+ </module>
+ <module>
+ <ejb>ejb-sample-two-1.0.jar</ejb>
+ </module>
+</application>
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-024</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ <classifier>classified</classifier>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-two</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <modules>
+ <ejbModule>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <classifier>classified</classifier>
+ <unpack>true</unpack>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-024/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+ <display-name>maven-ear-plugin-test-project-025</display-name>
+ <module>
+ <ejb>ejb-sample-one-1.0-classified.jar</ejb>
+ </module>
+ <module>
+ <ejb>ejb-sample-one-1.0.jar</ejb>
+ </module>
+</application>
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/expected-META-INF/application.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-025</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ <classifier>classified</classifier>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <modules>
+ <ejbModule>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <classifier>classified</classifier>
+ <unpack>true</unpack>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-025/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml?view=auto&rev=471117
==============================================================================
---
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
(added)
+++
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
Fri Nov 3 20:58:36 2006
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ear</groupId>
+ <artifactId>maven-ear-plugin-test-project-026</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ <classifier>classified</classifier>
+ </dependency>
+ <dependency>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <version>1.0</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <modules>
+ <ejbModule>
+ <groupId>eartest</groupId>
+ <artifactId>ejb-sample-one</artifactId>
+ <unpack>true</unpack>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-026/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision