jetty-9 jetty-plugins now reads from multiple cofigurable groupIds. Currently org/eclipse/jetty and org/mortbay/jetty

This commit is contained in:
Thomas Becker 2012-09-05 10:41:45 +02:00
parent 1b3d32e337
commit db3fbb9cb3
4 changed files with 103 additions and 106 deletions

View File

@ -26,6 +26,7 @@ import java.io.OutputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -38,7 +39,7 @@ import org.eclipse.jetty.plugins.util.StreamUtils;
public class HttpMavenService implements MavenService public class HttpMavenService implements MavenService
{ {
private static final String REPOSITORY_URL = "http://repo2.maven.org/maven2/"; private static final String REPOSITORY_URL = "http://repo2.maven.org/maven2/";
private static final String[] GROUP_IDS = new String[]{"org/eclipse/jetty"}; private static final String[] GROUP_IDS = new String[]{ "org/eclipse/jetty", "org/mortbay/jetty" };
private static final String VERSION = "9.0.0-SNAPSHOT"; // TODO: should be automatically set private static final String VERSION = "9.0.0-SNAPSHOT"; // TODO: should be automatically set
private boolean _searchRemoteRepository = true; private boolean _searchRemoteRepository = true;
private boolean _searchLocalRepository = false; private boolean _searchLocalRepository = false;
@ -79,6 +80,8 @@ public class HttpMavenService implements MavenService
break; break;
String[] localMavenModuleList = file.list(); String[] localMavenModuleList = file.list();
System.out.println("Trying the following modules: " + Arrays.toString(localMavenModuleList));
for (String potentialPlugin : localMavenModuleList) for (String potentialPlugin : localMavenModuleList)
{ {
File pluginFile = new File(_localRepository + getPluginPath(groupId,potentialPlugin)); File pluginFile = new File(_localRepository + getPluginPath(groupId,potentialPlugin));

View File

@ -51,7 +51,7 @@ public class HttpMavenServiceIntegrationTest
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
_mavenService.setRepositoryUrls(new String[]{PRIVATE_NEXUS_REPOSITORY_URL}); _mavenService.setRepositoryUrl(PRIVATE_NEXUS_REPOSITORY_URL);
} }
@Test @Test

View File

@ -38,7 +38,7 @@ public class HttpMavenServiceTest
public void setUp() throws Exception public void setUp() throws Exception
{ {
_mavenService.setLocalRepository(this.getClass().getClassLoader().getResource("maven_repo").getFile() + "/"); _mavenService.setLocalRepository(this.getClass().getClassLoader().getResource("maven_repo").getFile() + "/");
_mavenService.setRepositoryUrls(new String[]{MAVEN_CENTRAL_URL}); _mavenService.setRepositoryUrl(MAVEN_CENTRAL_URL);
_mavenService.setVersion("version"); _mavenService.setVersion("version");
_mavenService.setSearchRemoteRepository(false); _mavenService.setSearchRemoteRepository(false);
_mavenService.setSearchLocalRepository(true); _mavenService.setSearchLocalRepository(true);

View File

@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId> <artifactId>jetty-project</artifactId>
@ -25,9 +24,7 @@
</goals> </goals>
<configuration> <configuration>
<instructions> <instructions>
<Import-Package> <Import-Package>javax.servlet.*;version="2.6.0",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*</Import-Package>
javax.servlet.*;version="2.6.0",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*
</Import-Package>
</instructions> </instructions>
</configuration> </configuration>
</execution> </execution>
@ -58,9 +55,6 @@
<descriptorRefs> <descriptorRefs>
<descriptorRef>config</descriptorRef> <descriptorRef>config</descriptorRef>
</descriptorRefs> </descriptorRefs>
<descriptors>
<descriptor>src/main/assembly/plugin.xml</descriptor>
</descriptors>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>