Author: gcc
Date: Mon Aug  5 08:32:19 2013
New Revision: 1510383

URL: http://svn.apache.org/r1510383
Log:
ARIES-1094
Fixed <archiveContent>all</archiveContent>.  Added test for fix.  Removed 
unused site and it folders.

Added:
    
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub7.java
    
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/
    
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/
    
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.jar
   (with props)
    
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.pom
    aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/
    
aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml
Removed:
    aries/trunk/eba-maven-plugin/src/it/
    aries/trunk/eba-maven-plugin/src/site/
Modified:
    
aries/trunk/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java
    
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/EbaMojoTest.java
    
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub.java
    
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact02/1.0-SNAPSHOT/maven-artifact02-1.0-SNAPSHOT.pom

Modified: 
aries/trunk/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java?rev=1510383&r1=1510382&r2=1510383&view=diff
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java
 (original)
+++ 
aries/trunk/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java
 Mon Aug  5 08:32:19 2013
@@ -254,7 +254,7 @@ public class EbaMojo
         try
         {
             Set<Artifact> artifacts = null;
-            if (useTransitiveDependencies) {
+            if (useTransitiveDependencies || "all".equals(archiveContent)) {
                 // if use transitive is set (i.e. true) then we need to make 
sure archiveContent does not contradict (i.e. is set
                 // to the same compatible value or is the default).
                if ("none".equals(archiveContent)) {

Modified: 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/EbaMojoTest.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/EbaMojoTest.java?rev=1510383&r1=1510382&r2=1510383&view=diff
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/EbaMojoTest.java
 (original)
+++ 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/EbaMojoTest.java
 Mon Aug  5 08:32:19 2013
@@ -376,6 +376,55 @@ public class EbaMojoTest
 
     }
 
+    public void testArchiveContentConfigurationAllBundles()
+        throws Exception
+    {
+        File testPom = new File( getBasedir(),
+                                 
"target/test-classes/unit/basic-eba-all-bundles/plugin-config.xml" );
+
+        EbaMojo mojo = ( EbaMojo ) lookupMojo( "eba", testPom );
+
+        assertNotNull( mojo );
+
+        String finalName = ( String ) getVariableValueFromObject( mojo, 
"finalName" );
+
+        String workDir = ( String ) getVariableValueFromObject( mojo, 
"workDirectory" );
+
+        String outputDir = ( String ) getVariableValueFromObject( mojo, 
"outputDirectory" );
+
+        mojo.execute();
+
+
+        //check the generated eba file
+        File ebaFile = new File( outputDir, finalName + ".eba" );
+
+        assertTrue( ebaFile.exists() );
+
+        //expected files/directories inside the eba file
+        List expectedFiles = new ArrayList();
+
+        expectedFiles.add( 
"META-INF/maven/org.apache.maven.test/maven-eba-test/pom.properties" );
+        expectedFiles.add( 
"META-INF/maven/org.apache.maven.test/maven-eba-test/pom.xml" );
+        expectedFiles.add( 
"META-INF/maven/org.apache.maven.test/maven-eba-test/" );
+        expectedFiles.add( "META-INF/maven/org.apache.maven.test/" );
+        expectedFiles.add( "META-INF/maven/" );
+        expectedFiles.add( "META-INF/APPLICATION.MF" );
+        expectedFiles.add( "META-INF/" );
+        expectedFiles.add( "maven-artifact01-1.0-SNAPSHOT.jar" );
+        expectedFiles.add( "maven-artifact02-1.0-SNAPSHOT.jar" );
+        expectedFiles.add( "maven-artifact03-1.0-SNAPSHOT.jar" );
+
+        ZipFile eba = new ZipFile( ebaFile );
+
+        Enumeration entries = eba.getEntries();
+
+        assertTrue( entries.hasMoreElements() );
+
+        int missing = getSizeOfExpectedFiles(entries, expectedFiles);
+        assertEquals("Missing files: " + expectedFiles,  0, missing);
+
+    }
+
     private int getSizeOfExpectedFiles( Enumeration entries, List 
expectedFiles )
     {
         while( entries.hasMoreElements() )

Modified: 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub.java?rev=1510383&r1=1510382&r2=1510383&view=diff
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub.java
 (original)
+++ 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub.java
 Mon Aug  5 08:32:19 2013
@@ -110,17 +110,22 @@ public class EbaMavenProjectStub
     
     public Set getArtifacts()
     {   
-        Set artifacts = new HashSet();
- 
-        artifacts.add( createArtifact( "org.apache.maven.test", 
"maven-artifact01", "1.0-SNAPSHOT", false ) );
-        artifacts.add( createArtifact( "org.apache.maven.test", 
"maven-artifact02", "1.0-SNAPSHOT", false ) );
+        Set artifacts = getDependencyArtifacts();
+
+       // this one's a transitive dependency 
+        artifacts.add( createArtifact( "org.apache.maven.test", 
"maven-artifact03", "1.0-SNAPSHOT", false ) );
         
         return artifacts;
     }
 
     @Override
     public Set getDependencyArtifacts() {
-        return getArtifacts();
+        Set artifacts = new HashSet();
+ 
+        artifacts.add( createArtifact( "org.apache.maven.test", 
"maven-artifact01", "1.0-SNAPSHOT", false ) );
+        artifacts.add( createArtifact( "org.apache.maven.test", 
"maven-artifact02", "1.0-SNAPSHOT", false ) );
+        
+        return artifacts;
     }
 
     public List getAttachedArtifacts()

Added: 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub7.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub7.java?rev=1510383&view=auto
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub7.java
 (added)
+++ 
aries/trunk/eba-maven-plugin/src/test/java/org/apache/aries/plugin/eba/stubs/EbaMavenProjectStub7.java
 Mon Aug  5 08:32:19 2013
@@ -0,0 +1,31 @@
+package org.apache.aries.plugin.eba.stubs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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;
+
+public class EbaMavenProjectStub7
+    extends EbaMavenProjectStub
+{
+    public File getFile()
+    {
+        return new File( getBasedir(), 
"src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml" );
+    }
+}

Modified: 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact02/1.0-SNAPSHOT/maven-artifact02-1.0-SNAPSHOT.pom
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact02/1.0-SNAPSHOT/maven-artifact02-1.0-SNAPSHOT.pom?rev=1510383&r1=1510382&r2=1510383&view=diff
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact02/1.0-SNAPSHOT/maven-artifact02-1.0-SNAPSHOT.pom
 (original)
+++ 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact02/1.0-SNAPSHOT/maven-artifact02-1.0-SNAPSHOT.pom
 Mon Aug  5 08:32:19 2013
@@ -22,4 +22,15 @@
   <groupId>org.apache.maven.test</groupId>
   <artifactId>maven-artifact02</artifactId>
   <version>1.0-SNAPSHOT</version>
+
+  <!-- define a transitive dependency on artifact03 -->
+  <dependencies>
+      <dependency>
+          <groupId>org.apache.maven.test</groupId>
+          <artifactId>maven-artifact03</artifactId>
+         <version>1.0-SNAPSHOT</version>
+      </dependency>
+  </dependencies>
+
+
 </project>

Added: 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.jar
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.jar?rev=1510383&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.pom
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.pom?rev=1510383&view=auto
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.pom
 (added)
+++ 
aries/trunk/eba-maven-plugin/src/test/remote-repo/org/apache/maven/test/maven-artifact03/1.0-SNAPSHOT/maven-artifact03-1.0-SNAPSHOT.pom
 Mon Aug  5 08:32:19 2013
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>maven-artifact03</artifactId>
+  <version>1.0-SNAPSHOT</version>
+</project>

Added: 
aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml
URL: 
http://svn.apache.org/viewvc/aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml?rev=1510383&view=auto
==============================================================================
--- 
aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml
 (added)
+++ 
aries/trunk/eba-maven-plugin/src/test/resources/unit/basic-eba-all-bundles/plugin-config.xml
 Mon Aug  5 08:32:19 2013
@@ -0,0 +1,38 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor 
+       license agreements. See the NOTICE file distributed with this work for 
additional 
+       information regarding copyright ownership. The ASF licenses this file 
to 
+       you 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. -->
+
+<project>
+       <build>
+               <plugins>
+                       <plugin>
+                               <artifactId>eba-maven-plugin</artifactId>
+                               <configuration>
+                                       
<ebaSourceDirectory>${basedir}/src/test/resources/unit/basic-eba-all-bundles/src/main/eba</ebaSourceDirectory>
+                                       
<generateManifest>true</generateManifest>
+                                       <archiveContent>all</archiveContent>
+                                       <instructions>
+                                       </instructions>
+                                       <includeJar>false</includeJar>
+                                       
<addMavenDescriptor>true</addMavenDescriptor>
+                                       
<includeEmptyDirs>true</includeEmptyDirs>
+                                       
<workDirectory>${basedir}/target/unit/basic-eba-all-bundles/target/eba-test-all-bundles
+                                       </workDirectory>
+                                       
<sharedResources>${basedir}/target/unit/basic-eba-all-bundles/target/maven-shared-archive-resources
+                                       </sharedResources>
+                                       
<outputDirectory>${basedir}/target/unit/basic-eba-all-bundles/target
+                                       </outputDirectory>
+                                       
<finalName>test-eba-all-bundles</finalName>
+                                       <project 
implementation="org.apache.aries.plugin.eba.stubs.EbaMavenProjectStub7" />
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+</project>


Reply via email to