Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Starting work on SourceForge -> GitHub migration;

  • Loading branch information...
commit 944e3f17fcb4699b57fe5e64e217d98002e17006 1 parent 067d2c9
@buzdin buzdin authored
View
47 sf-migration/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2005-2010 the original author or authors.
+
+ 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.
+-->
+<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>
+
+ <parent>
+ <groupId>net.sf.dozer</groupId>
+ <artifactId>dozer-parent</artifactId>
+ <version>5.4.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>sf-migration</artifactId>
+ <packaging>jar</packaging>
+ <name>SourceForge to GitHub Issue Tracker Migration</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.mylyn.github</groupId>
+ <artifactId>org.eclipse.egit.github.core</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>2.9</version>
+ </dependency>
+ </dependencies>
+
+</project>
View
26 sf-migration/src/main/java/org/dozer/migration/Migrator.java
@@ -0,0 +1,26 @@
+package org.dozer.migration;
+
+import org.eclipse.egit.github.core.Issue;
+import org.eclipse.egit.github.core.Repository;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.service.IssueService;
+import org.eclipse.egit.github.core.service.RepositoryService;
+
+/**
+ * @author Dmitry Buzdin
+ */
+public class Migrator {
+
+ public static void main(String[] args) throws Exception{
+ GitHubClient client = new GitHubClient();
+ client.setCredentials("user", "passw0rd");
+
+ RepositoryService repositoryService = new RepositoryService();
+ Repository repository = repositoryService.getRepository("DozerMapper", "dozer");
+
+ IssueService issueService = new IssueService();
+ Issue issue = new Issue();
+ issueService.createIssue("buzdin", "", issue);
+ }
+
+}
View
26 sf-migration/src/main/java/org/dozer/migration/Reader.java
@@ -0,0 +1,26 @@
+package org.dozer.migration;
+
+import org.dozer.migration.jaxb.Project;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import java.io.File;
+import java.net.URL;
+
+/**
+ * @author Dmitry Buzdin
+ */
+public class Reader {
+
+ public static void main(String[] args) throws Exception {
+ URL resource = Reader.class.getClassLoader().getResource("sfexport.xml");
+ File file = new File(resource.toURI() );
+ JAXBContext jaxbContext = JAXBContext.newInstance(Project.class);
+
+ Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
+ Project project = (Project) jaxbUnmarshaller.unmarshal(file);
+
+ System.out.println(project.getArtifacts().size());
+ }
+
+}
View
23 sf-migration/src/main/java/org/dozer/migration/jaxb/Artifact.java
@@ -0,0 +1,23 @@
+package org.dozer.migration.jaxb;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Dmitry Buzdin
+ */
+@XmlRootElement(name = "artifact")
+public class Artifact {
+
+ List<Field> fields = new ArrayList<Field>();
+
+ public List<Field> getFields() {
+ return fields;
+ }
+
+ public void setFields(List<Field> fields) {
+ this.fields = fields;
+ }
+
+}
View
18 sf-migration/src/main/java/org/dozer/migration/jaxb/Field.java
@@ -0,0 +1,18 @@
+package org.dozer.migration.jaxb;
+
+import javax.xml.bind.annotation.*;
+
+/**
+ * @author Dmitry Buzdin
+ */
+@XmlRootElement(name = "field")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Field {
+
+ @XmlAttribute(name = "name")
+ String name;
+
+// @XmlValue
+ String value;
+
+}
View
23 sf-migration/src/main/java/org/dozer/migration/jaxb/Project.java
@@ -0,0 +1,23 @@
+package org.dozer.migration.jaxb;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Dmitry Buzdin
+ */
+@XmlRootElement(name = "project_export")
+public class Project {
+
+ List<Artifact> artifacts = new ArrayList<Artifact>();
+
+ public List<Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(List<Artifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+}
View
64,851 sf-migration/src/main/resources/sfexport.xml
64,851 additions, 0 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.