update Hudson example
diff --git a/org.eclipse.mylyn.examples.hudson.standalone/pom.xml b/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
index 25a9456..68dfd71 100644
--- a/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
+++ b/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
@@ -84,12 +84,12 @@
</dependency>
<dependency>
<groupId>org.eclipse.mylyn.commons</groupId>
- <artifactId>org.eclipse.mylyn.commons.net</artifactId>
- <version>3.7.0-SNAPSHOT</version>
+ <artifactId>org.eclipse.mylyn.commons.repositories.core</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.mylyn.commons</groupId>
- <artifactId>org.eclipse.mylyn.commons.repositories</artifactId>
+ <artifactId>org.eclipse.mylyn.commons.repositories.http.core</artifactId>
<version>0.9.0-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git a/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java b/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
index efb48e4..f157942 100644
--- a/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
+++ b/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
@@ -11,22 +11,6 @@
package org.eclipse.mylyn.internal.examples.hudson.standalone;
import java.util.List;
-import java.util.UUID;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.builds.core.IBuildPlan;
-import org.eclipse.mylyn.builds.core.spi.BuildServerBehaviour;
-import org.eclipse.mylyn.builds.core.spi.BuildServerConfiguration;
-import org.eclipse.mylyn.commons.net.WebLocation;
-import org.eclipse.mylyn.commons.repositories.RepositoryLocation;
-import org.eclipse.mylyn.internal.commons.net.CommonsNetPlugin;
-import org.eclipse.mylyn.internal.commons.repositories.InMemoryCredentialsStore;
-import org.eclipse.mylyn.internal.hudson.core.HudsonConnector;
-import org.eclipse.mylyn.internal.hudson.core.client.HudsonConfigurationCache;
-import org.eclipse.mylyn.internal.hudson.core.client.HudsonException;
-import org.eclipse.mylyn.internal.hudson.core.client.RestfulHudsonClient;
-import org.eclipse.mylyn.internal.hudson.model.HudsonModelJob;
-import org.eclipse.osgi.util.NLS;
/**
* @author Steffen Pingel
@@ -48,14 +32,10 @@
private static void framworkApiExample() throws CoreException {
RepositoryLocation location = new RepositoryLocation();
- location.setProperty(RepositoryLocation.PROPERTY_ID, UUID.randomUUID().toString());
- location.setCredentialsStore(new InMemoryCredentialsStore(null));
+ location.setUrl("http://ci.mylyn.org/");
+ //location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("username", "password"));
- location.setProperty(RepositoryLocation.PROPERTY_URL, "http://ci.mylyn.org/");
-// AuthenticationCredentials credentials = new UsernamePasswordCredentials("username", "password");
-// location.setCredentials(org.eclipse.mylyn.commons.repositories.auth.AuthenticationType.REPOSITORY, credentials);
-
- HudsonConnector connector = new HudsonConnector();
+ BuildConnector connector = HudsonCore.createConnector(null);
BuildServerBehaviour behavior = connector.getBehaviour(location);
System.out.println(NLS.bind("= Listing all jobs on {0} =", location.getUrl()));
@@ -66,8 +46,9 @@
}
private static void hudsonApiExample() throws HudsonException {
- WebLocation location = new WebLocation("http://ci.mylyn.org/");
-// location.setCredentials(AuthenticationType.HTTP, "username", "password");
+ RepositoryLocation location = new RepositoryLocation();
+ location.setUrl("http://mylyn.org/jenkins-latest");
+ //location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("username", "password"));
RestfulHudsonClient client = new RestfulHudsonClient(location, new HudsonConfigurationCache());