]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1607] maven model build failed when model have jdk profile activation.
authorOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 09:07:03 +0000 (09:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 26 Feb 2012 09:07:03 +0000 (09:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1293788 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java

index 3a039693d8272474473031e79c4c64adc93a2b59..76efced97399f75da6f8bc274e3bc97cb175a2eb 100644 (file)
@@ -186,6 +186,20 @@ $(function() {
       $(this).parent("li").addClass("active");
     })
 
+    $( "#quick-search-autocomplete" ).autocomplete({
+
+                       minLength: 3,
+                       source: function( request, response ) {
+        $.log("source");
+        return ["foo","bar"];
+                               /*var data = $.getJSON( "restServices/archivaServices/searchService/quickSearch?queryString="+encodeURIComponent(request.term));
+        return $.map(data,function(item){
+          return item.artifactId;
+        })*/
+                         }
+               });
+
+
   }
   startArchivaApplication();
 })
index ec1c024b944397db39e804e34197972863c2e328..b2ebff1c36603ccc3e022635b884d720f58285ab 100644 (file)
@@ -49,7 +49,7 @@
         </li>
         <li class="pull-right">
             <form class="form-search pull-right" action="">
-              <input type="text" class="search-query" placeholder="Search" />
+              <input type="text" class="ui-widget" id="quick-search-autocomplete" placeholder="Search" />
             </form>
         </li>
       </ul>
index ed7d93086e6eaaaf041f68ff18c9024f442156e7..4e70d48f5e0e1e135bc0a34acbe539a3c90e347d 100644 (file)
@@ -226,6 +226,12 @@ public class Maven2RepositoryStorage
                     .setTwoPhaseBuilding( false )
                     .setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
 
+
+            //MRM-1607. olamy this will resolve jdk profiles on the current running archiva jvm
+            req.setSystemProperties( System.getProperties() );
+
+
+
             // MRM-1411
             req.setModelResolver(
                 new RepositoryModelResolver( basedir, pathTranslator, wagonFactory, remoteRepositories, networkProxies,
index 1f864cd727ede1bd2e82c1d9093f9d02849ea140..20b839d5e7466f085a879f8a1c22f7af27bf17bc 100644 (file)
@@ -131,6 +131,16 @@ public class Maven2RepositoryMetadataResolverTest
         when( wagonFactory.getWagon( "wagon#http" ) ).thenReturn( wagon );
     }
 
+    @Test
+    public void testModelWithJdkProfileActivation()
+        throws Exception
+    {
+
+        ProjectVersionMetadata metadata =
+            storage.readProjectVersionMetadata( TEST_REPO_ID, "org.apache.maven", "maven-archiver", "2.4.1" );
+        MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
+    }
+
     @Test
     public void testGetProjectVersionMetadata()
         throws Exception
@@ -633,10 +643,11 @@ public class Maven2RepositoryMetadataResolverTest
         assertEquals( Arrays.asList( "apache" ), storage.listProjects( TEST_REPO_ID, "org.apache", ALL ) );
         assertEquals( Arrays.asList( "archiva", "archiva-base", "archiva-common", "archiva-modules", "archiva-parent" ),
                       storage.listProjects( TEST_REPO_ID, "org.apache.archiva", ALL ) );
-        assertEquals( Collections.<String>emptyList(), storage.listProjects( TEST_REPO_ID, "org.apache.maven", ALL ) );
+        assertEquals( Arrays.asList( "maven-archiver", "maven-parent" ),
+                      storage.listProjects( TEST_REPO_ID, "org.apache.maven", ALL ) );
         assertEquals( Collections.<String>emptyList(),
                       storage.listProjects( TEST_REPO_ID, "org.apache.maven.plugins", ALL ) );
-        assertEquals( Arrays.asList( "maven-downloader" ),
+        assertEquals( Arrays.asList( "maven-downloader", "maven-shared-components" ),
                       storage.listProjects( TEST_REPO_ID, "org.apache.maven.shared", ALL ) );
     }
 
@@ -653,7 +664,7 @@ public class Maven2RepositoryMetadataResolverTest
         assertEquals( Arrays.asList( "1.0" ),
                       storage.listProjectVersions( TEST_REPO_ID, "com.example.test", "invalid-pom", ALL ) );
 
-        assertEquals( Arrays.asList( "4", "5-SNAPSHOT" ),
+        assertEquals( Arrays.asList( "4", "5-SNAPSHOT", "7" ),
                       storage.listProjectVersions( TEST_REPO_ID, "org.apache", "apache", ALL ) );
 
         assertEquals( Arrays.asList( "1.2.1", "1.2.2" ),