Hi David,

will it work correctly since maven uses 4.0.0 version too for project model
version?

- Romain


---------- Forwarded message ----------
From: <[email protected]>
Date: 2012/4/13
Subject: svn commit: r1325623 - in
/openejb/trunk/sandbox/release-tools/src/main:
java/org/apache/openejb/tools/release/
java/org/apache/openejb/tools/release/cmd/ resources/
To: [email protected]


Author: dblevins
Date: Fri Apr 13 06:14:51 2012
New Revision: 1325623

URL: http://svn.apache.org/viewvc?rev=1325623&view=rev
Log:
Tools to compare libraries from one version to the next
Tweaks to finalizing verions
More

Added:

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Branch.java
     - copied, changed from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CommitsPerDay.java
     - copied, changed from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CompareLibraries.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/FinalizeVersions.java
     - copied, changed from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/JiraReport.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/SnapshotfreeBuild.java
   openejb/trunk/sandbox/release-tools/src/main/resources/recent.vm
Removed:

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
Modified:

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java

 
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java

Modified:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java?rev=1325623&r1=1325622&r2=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/Release.java
Fri Apr 13 06:14:51 2012
@@ -31,8 +31,8 @@ import java.util.regex.Pattern;
 */
 public class Release {

-    public static String openejbVersion = "4.0.0-beta-2";
-    public static String tomeeVersion = "1.0.0-beta-2";
+    public static String openejbVersion = "4.0.0";
+    public static String tomeeVersion = "1.0.0";

    public static String openejbVersionName = "openejb-${openejbVersion}";
    public static String tomeeVersionName = "tomee-${tomeeVersion}";
@@ -44,7 +44,7 @@ public class Release {
    public static String tckTrunk = "
https://svn.apache.org/repos/tck/openejb-tck/trunk";;

    public static String staging = "
https://repository.apache.org/content/repositories/orgapacheopenejb-${build}
";
-    public static String build = "075";
+    public static String build = "041";


    public static String builddir = "/tmp/downloads";

Modified:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java?rev=1325623&r1=1325622&r2=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/AdvanceVersions.java
Fri Apr 13 06:14:51 2012
@@ -102,6 +102,7 @@ public class AdvanceVersions {
            in = new ReplaceStringInputStream(in, "1.0.0-beta-2-SNAPSHOT",
"1.0.0-beta-3-SNAPSHOT");
            in = new ReplaceStringInputStream(in, "6.0-3-SNAPSHOT",
"6.0-3");
            in = new ReplaceStringInputStream(in, "1.3-SNAPSHOT", "1.2");
+            in = new ReplaceStringInputStream(in, "1.1.2-SNAPSHOT",
"1.1.3");
            in = new ReplaceStringInputStream(in, "2.5.1-SNAPSHOT",
"2.5.1");

            update(file, in);

Modified:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java?rev=1325623&r1=1325622&r2=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java
Fri Apr 13 06:14:51 2012
@@ -35,7 +35,7 @@ public class Binaries {
        final NexusClient client = new NexusClient();

        final File dir = Files.file(Release.builddir, "staging-" +
Release.build, Release.openejbVersionName);
-        final URI repo = URI.create(Release.staging);
+        final URI repo = URI.create("
https://repository.apache.org/content/groups/public/org/apache/openejb";);

        System.out.println("Downloads: " + dir.getAbsolutePath());


Copied:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Branch.java
(from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java)
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Branch.java?p2=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Branch.java&p1=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java&r1=1237535&r2=1325623&rev=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Tag.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Branch.java
Fri Apr 13 06:14:51 2012
@@ -26,18 +26,18 @@ import static org.apache.openejb.tools.r
 * @version $Rev$ $Date$
 */
 @Command
-public class Tag {
+public class Branch {

    public static void main(String... args) throws Exception {

        final String branch = Release.branches + Release.openejbVersionName;
-        final String tag = Release.tags + Release.openejbVersionName;
+        final String trunk = Release.trunk;

-        if (exec("svn", "info", tag) == 0) {
-            exec("svn", "-m", format("[release-tools] recreating tag for
%s", Release.openejbVersionName), "rm", tag);
+        if (exec("svn", "info", branch) == 0) {
+            exec("svn", "-m", format("[release-tools] recreating branch
for %s", Release.openejbVersionName), "rm", branch);
        }

-        exec("svn", "-m", format("[release-tools] creating tag for %s",
Release.openejbVersionName), "cp", branch, tag);
+        exec("svn", "-m", format("[release-tools] creating branch for %s",
Release.openejbVersionName), "cp", trunk, branch);
    }

 }

Copied:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CommitsPerDay.java
(from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java)
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CommitsPerDay.java?p2=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CommitsPerDay.java&p1=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java&r1=1237535&r2=1325623&rev=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/ReviewCommits.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CommitsPerDay.java
Fri Apr 13 06:14:51 2012
@@ -39,22 +39,25 @@ import java.lang.reflect.Field;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;

 /**
 * @version $Rev$ $Date$
 */
 @Command
-public class ReviewCommits {
-
-    private static BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
+public class CommitsPerDay {

    public static void main(String... args) throws Exception {

-        final String tag = Release.tags + Release.openejbVersionName;
+        final String tag = "http://svn.apache.org/repos/asf/openejb/";;
+
+        final String start = "2007-01-01";

-        final InputStream in = Exec.read("svn", "log", "--verbose",
"--xml", "-rHEAD:{" + Release.lastReleaseDate + "}", tag);
+        final InputStream in = Exec.read("svn", "log", "--xml", "-rHEAD:{"
+ start + "}", tag);

        final JAXBContext context =
JAXBContext.newInstance(Commit.Log.class);
        final Unmarshaller unmarshaller = context.createUnmarshaller();
@@ -64,288 +67,42 @@ public class ReviewCommits {
        ObjectList<Commit> commits = log.getCommits();
        commits = commits.ascending("revision");

-        for (Commit commit : commits) {
-            final String[] tokens =
commit.getMessage().split("[^A-Z0-9-]+");
-            for (String token : tokens) {
-                if (token.matches("(OPENEJB|TOMEE)-[0-9]+")) {
-                    try {
-                        addIssue(getJira().getIssue(token));
-                    } catch (Exception e) {
-                        System.out.printf("Invalid JIRA '%s'\n", token);
-                    }
-                }
-            }
-        }
-
-        final Date reviewed = new
SimpleDateFormat("yyyy-MM-dd").parse("2012-01-05");
-        commits = commits.greater("date", reviewed);
-        commits = commits.subtract(commits.contains("message",
"OPENEJB-"));
-        commits = commits.subtract(commits.contains("message", "TOMEE-"));
+        final Date end = new Date();

-        System.out.printf("Are you ready to review %s commits?",
commits.size());
-        System.out.println();
+        Date date = new SimpleDateFormat("yyyy-MM-dd").parse(start);

-        for (Commit commit : commits) {
-            handle(commit);
-        }
+        final ListIterator<Commit> iterator = commits.listIterator();

-//        for (Commit commit : commits) {
-//            System.out.println(commit);
-//        }
-//
+        while (lesser(date, end)) {

-    }
-
-    public static boolean handle(Commit commit) {
-        for (Commit.Path path : commit.getPaths()) {
-            System.out.printf(" %s %s", path.getAction(), path.getPath());
-            System.out.println();
-        }
-        System.out.println(commit);
+            int c = 0;

-        System.out.printf("[%s]: ", Join.join(", ", Key.values()));
+            Date next = increment(date);

-        final String line = readLine().toUpperCase();
-
-        try {
-            final Key key = Key.valueOf(line);
-            if (!key.pressed(commit)) handle(commit);
-        } catch (IllegalArgumentException e) {
-            return handle(commit);
-        }
-
-        return true;
-    }
-
-    private static String prompt(String s) {
-        System.out.printf("%s : ", s);
-        final String value = readLine();
-        return (value == null || value.length() == 0) ? s : value;
-    }
-
-    /**
-     * Sort of a mini clipboard of recently seen issues
-     */
-    private static List<Issue> last = new ArrayList<Issue>();
-
-    private static void addIssue(Issue issue) {
-        last.remove(issue);
-        last.add(0, issue);
-        while (last.size() > 20) {
-            last.remove(last.size() - 1);
-        }
-    }
-
-    private static Jira jira;
-    private static List<IssueType> issueTypes = new ArrayList<IssueType>();
-
-    public static Jira getJira() {
-        if (jira == null) {
-            try {
-                final Options options = new
Options(System.getProperties());
-                Jira jira = new Jira("
http://issues.apache.org/jira/rpc/xmlrpc";);
-                jira.login(options.get("username", ""),
options.get("password", ""));
-                ReviewCommits.jira = jira;
-
-                issueTypes.add(jira.getIssueType("Improvement"));
-                issueTypes.add(jira.getIssueType("New Feature"));
-                issueTypes.add(jira.getIssueType("Bug"));
-                issueTypes.add(jira.getIssueType("Task"));
-                issueTypes.add(jira.getIssueType("Dependency upgrade"));
-
-            } catch (Exception e) {
-                throw new IllegalStateException(e);
-            }
-        }
-        return jira;
-    }
-
-    public static enum Key {
-        V(new Action() {
-            @Override
-            public boolean perform(Commit commit) {
-                Exec.exec("open", String.format("
http://svn.apache.org/viewvc?view=revision&revision=%s";,
commit.getRevision()));
-                return false;
-            }
-        }),
-
-        // ASSOCIATE with a JIRA issue
-        A(new Action() {
-            @Override
-            public boolean perform(Commit commit) {
-                int i = 0;
-
-                final List<Issue> issues = new ArrayList<Issue>(last);
-
-                for (Issue issue : issues) {
-                    System.out.printf("%s) %s: %s\n", i++, issue.getKey(),
issue.getSummary());
-                }
-
-                final String[] split = prompt("issues?").split(" +");
-                for (String key : split) {
-
-                    final Issue issue = resolve(key, issues);
-                    if (issue == null) {
-                        System.out.println("No such issue " + key);
-                        continue;
-                    }
-
-                    addIssue(issue);
-                    System.out.printf("Associating %s", issue.getKey());
-                    System.out.println();
-                    updateCommitMessage(commit, issue);
+            while (iterator.hasNext()) {
+                final Commit commit = iterator.next();
+                if (lesser(commit.getDate(), next)) {
+                    c++;
+                } else {
+                    iterator.previous();
+                    break;
                }
-
-                return false;
-            }
-
-        }),
-
-        // NEXT commit
-        N(new Action() {
-            @Override
-            public boolean perform(Commit commit) {
-                return true;
            }
-        }),

-        // CREATE jira
-        C(new Action() {
+            System.out.print(c + ", ");

-            @Override
-            public boolean perform(Commit commit) {
-
-                try {
-                    final Jira jira = getJira();
-
-                    final String summary = prompt("summary");
-                    final String project = prompt("TOMEE");
-                    final String version = prompt("TOMEE".equals(project)
? Release.tomeeVersion : Release.openejbVersion);
-                    final String type =
prompt("Improvement").toLowerCase();
-
-                    Issue issue = new Issue();
-
-                    if (project.equalsIgnoreCase("o")) {
-                        issue.setProject(jira.getProject("OPENEJB"));
-                    } else {
-                        issue.setProject(jira.getProject(project));
-                    }
-                    issue.setSummary(summary);
-
-                    // Set default to Improvement
-                    issue.setType(issueTypes.get(0));
-                    for (IssueType issueType : issueTypes) {
-                        if
(issueType.getName().toLowerCase().startsWith(type)) {
-                            issue.setType(issueType);
-                            break;
-                        }
-                    }
-
-                    final Version v = jira.getVersion(issue.getProject(),
version);
-                    issue.getFixVersions().add(v);
-
-                    System.out.printf("%s %s\n%s %s\n",
issue.getProject(), issue.getSummary(), issue.getType(), Join.join(",",
issue.getFixVersions()));
-                    final String prompt = prompt("create?");
-
-                    if (prompt.equals("create?") || prompt.equals("yes")) {
-                        try {
-                            final Issue jiraIssue = createIssue(jira,
issue);
-                            addIssue(jiraIssue);
-
-                            System.out.println(jiraIssue.getKey());
-
-                            updateCommitMessage(commit, jiraIssue);
-                        } catch (Exception e) {
-                            System.out.println("Could not create jira
issue");
-                            e.printStackTrace();
-                        }
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-
-                return false;
-            }
-
-        });
-
-        private static Issue createIssue(Jira jira, Issue issue) throws
Exception {
-            trimIssue(issue);
-
-            return jira.createIssue(issue);
-        }
-
-
-        private static Issue resolve(String key, List<Issue> issues) {
-            try {
-                return issues.get(new Integer(key));
-            } catch (Exception e) {
-            }
-
-
-            try {
-                return getJira().getIssue(key);
-            } catch (Exception e) {
-            }
-
-            return null;
-        }
-
-        private static void updateCommitMessage(Commit commit, Issue
issue) {
-            final String oldMessage = commit.getMessage();
-
-            if (oldMessage.contains(issue.getKey())) return;
-
-            final String newMessage = String.format("%s\n%s: %s",
oldMessage, issue.getKey(), issue.getSummary());
-
-            Exec.exec("svn", "propset", "-r", commit.getRevision() + "",
"--revprop", "svn:log", newMessage, "https://svn.apache.org/repos/asf";);
-        }
-
-
-        private final Action action;
-
-        Key(Action action) {
-            this.action = action;
-        }
-
-        public boolean pressed(Commit commit) {
-            return action.perform(commit);
-        }
-    }
-
-    public static String v(String version) {
-        return version.replaceFirst("^[a-z]+-", "");
-    }
-
-    public static Issue trimIssue(Issue issue) throws
NoSuchFieldException, IllegalAccessException {
-        toMap(issue).remove("votes");
-
-        for (Version version : issue.getFixVersions()) {
-            toMap(version).remove("archived");
-            toMap(version).remove("sequence");
-            toMap(version).remove("released");
-            toMap(version).remove("releaseDate");
+            date = next;
        }

-        return issue;
    }

-    public static Map toMap(MapObject issue) throws NoSuchFieldException,
IllegalAccessException {
-        final Field fields = MapObject.class.getDeclaredField("fields");
-        fields.setAccessible(true);
-        return (Map) fields.get(issue);
+    private static boolean lesser(Date a, Date b) {
+        return a.compareTo(b) < 0;
    }

-    public static interface Action {
-
-        boolean perform(Commit commit);
-    }
-
-    private static String readLine() {
-        try {
-            return in.readLine();
-        } catch (IOException e) {
-            throw new IllegalStateException(e);
-        }
+    private static Date increment(Date previous) {
+        final long l = TimeUnit.DAYS.toMillis(30);
+        final long time = previous.getTime() + l;
+        return new Date(time);
    }
 }

Added:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CompareLibraries.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CompareLibraries.java?rev=1325623&view=auto
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CompareLibraries.java
(added)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/CompareLibraries.java
Fri Apr 13 06:14:51 2012
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+package org.apache.openejb.tools.release.cmd;
+
+import org.apache.openejb.tools.release.util.Exec;
+import org.apache.openejb.tools.release.util.Files;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CompareLibraries {
+
+    public static void main(String... args) throws IOException {
+        final File repository =
Files.file(System.getProperty("user.home"), ".m2", "repository", "org",
"apache", "openejb");
+
+        //
/Users/dblevins/.m2/repository/org/apache/openejb/apache-tomee/1.0.0/apache-tomee-1.0.0-webprofile.zip
+
+        diff(repository, "apache-tomee", "1.0.0-beta-2", "1.0.0",
"webprofile");
+
+        diff(repository, "apache-tomee", "1.0.0-beta-2", "1.0.0", "plus");
+
+        diff(repository, "openejb-standalone", "4.0.0-beta-2", "4.0.0",
null);
+
+
+    }
+
+    private static void diff(File repository, final String artifactId,
final String versionA, final String versionB, final String classifier)
throws IOException {
+        System.out.printf("\n%s %s %s\n\n", artifactId, versionB,
(classifier == null) ? "" : classifier);
+
+        final File previous = artifact(repository, artifactId, versionA,
classifier);
+        final File current = artifact(repository, artifactId, versionB,
classifier);
+
+        final Map<String, File> a = libraries(previous);
+        final Map<String, File> b = libraries(current);
+
+        for (String key : a.keySet()) {
+            if (b.containsKey(key)) continue;
+            System.out.printf("  D %s\n", path(a, key));
+        }
+
+        for (String key : b.keySet()) {
+            if (a.containsKey(key)) continue;
+            System.out.printf("  A %s\n", path(b, key));
+        }
+
+        System.out.println();
+        final long change = current.length() - previous.length();
+        System.out.printf("  change: %s%.2f MB\n", change > 0 ? "+" : "",
toMB(change));
+        System.out.printf("  total : %.2f MB\n\n", toMB(current.length()));
+
+    }
+
+    private static double toMB(final double length) {
+        return length / 1024 / 1024;
+    }
+
+    private static String path(Map<String, File> b, String key) {
+        return b.get(key).getName();
+//        return b.get(key).getAbsolutePath().replace(new
File("").getAbsolutePath(),"");
+    }
+
+    private static Map<String, File> libraries(final File file) throws
IOException {
+
+        final Map<String, File> map = new TreeMap<String, File>();
+        for (File jar : list(file)) {
+            final String name = jar.getName().replaceFirst("-[0-9].+", "");
+            map.put(name, jar);
+        }
+
+        return map;
+    }
+
+    private static File artifact(File repository, String artifactId,
String version, String classifier) {
+
+        final String zip = classifier != null ? artifactId + "-" + version
+ "-" + classifier + ".zip" : artifactId + "-" + version + ".zip";
+
+        final File file = Files.file(repository, artifactId, version, zip);
+
+        if (file.exists()) return file;
+
+        // download the artifact
+        final String artifact;
+
+        if (classifier != null) {
+            artifact = "-Dartifact=" +
String.format("org.apache.openejb:%s:%s:%s:%s", artifactId, version, "zip",
classifier);
+        } else {
+            artifact = "-Dartifact=" +
String.format("org.apache.openejb:%s:%s:%s", artifactId, version, "zip");
+        }
+
+        final int i = Exec.exec("mvn", "-X",
"org.apache.maven.plugins:maven-dependency-plugin:2.4:get", "-DrepoUrl=
http://repo1.maven.apache.org/maven2";, artifact);
+
+        if (i != 0) {
+            throw new IllegalStateException("Download failed: " + i);
+        }
+
+        return artifact(repository, artifactId, version, classifier);
+    }
+
+    private static List<File> list(File previousFile) throws IOException {
+        final List<File> files = new ArrayList<File>();
+
+        final ZipFile previousZip = new ZipFile(previousFile);
+        final ArrayList<? extends ZipEntry> list =
Collections.list(previousZip.entries());
+        for (ZipEntry entry : list) {
+            if (entry.isDirectory()) continue;
+            if (!entry.getName().endsWith(".jar")) continue;
+            files.add(new File(entry.getName()));
+        }
+        return files;
+    }
+}

Modified:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java?rev=1325623&r1=1325622&r2=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Deploy.java
Fri Apr 13 06:14:51 2012
@@ -35,7 +35,8 @@ public class Deploy {

        // TODO Look for gpg on the path, report error if not found

-        final String tag = Release.tags + Release.openejbVersionName;
+//        final String tag = Release.tags + Release.openejbVersionName;
+        final String tag = Release.branches + Release.openejbVersionName;

        final File dir = new File(Release.workdir);
        Files.mkdir(dir);

Copied:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/FinalizeVersions.java
(from r1237535,
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java)
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/FinalizeVersions.java?p2=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/FinalizeVersions.java&p1=openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java&r1=1237535&r2=1325623&rev=1325623&view=diff
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/UpdateVersions.java
(original)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/FinalizeVersions.java
Fri Apr 13 06:14:51 2012
@@ -36,8 +36,8 @@ import static org.apache.openejb.tools.r
 /**
 * @version $Rev$ $Date$
 */
-@Command(dependsOn = Close.class)
-public class UpdateVersions {
+@Command(dependsOn = {Branch.class})
+public class FinalizeVersions {

    public static void main(String... args) throws Exception {

@@ -48,32 +48,46 @@ public class UpdateVersions {

        final String branch = Release.branches + Release.openejbVersionName;

-        // Make the branch
-        if (exec("svn", "info", branch) != 0) {
-
-            exec("svn", "-m", format("[release-tools] tck branch for %s",
Release.openejbVersionName), "cp", Release.trunk, branch);
-        }
-
        // Checkout the branch
        exec("svn", "co", branch);

        final File workingCopy = cd(new File(dir + "/" +
Release.openejbVersionName));

        updateVersions(workingCopy);
+        updateExamplesVersions(Files.file(workingCopy, "examples"));

-        exec("svn", "-m", "[release-tools] update staging repo for " +
Release.openejbVersionName, "ci");
+//        exec("svn", "-m", "[release-tools] finalizing versions for " +
Release.openejbVersionName, "ci");
+        exec("svn", "-m", "finalizing versions in arquillian.xml files",
"ci");
    }

    private static void updateVersions(File workingCopy) throws IOException
{

        final List<File> files = collect(workingCopy, ".*pom.xml");
        files.addAll(collect(workingCopy, ".*build.xml"));
+        files.addAll(collect(workingCopy, ".*arquillian.xml"));
+
+        for (File file : files) {
+            InputStream in = IO.read(file);
+
+            in = new ReplaceStringInputStream(in, "1.0.0-beta-3-SNAPSHOT",
"1.0.0");
+            in = new ReplaceStringInputStream(in, "4.0.0-beta-3-SNAPSHOT",
"4.0.0");
+
+            update(file, in);
+        }
+
+    }
+
+    private static void updateExamplesVersions(File workingCopy) throws
IOException {
+
+        final List<File> files = collect(workingCopy, ".*pom.xml");
+        files.addAll(collect(workingCopy, ".*build.xml"));

        for (File file : files) {
            InputStream in = IO.read(file);

-            in = new ReplaceStringInputStream(in, "1.0.0-beta-2-SNAPSHOT",
"1.0.0-beta-3-SNAPSHOT");
-            in = new ReplaceStringInputStream(in, "4.0.0-beta-2-SNAPSHOT",
"4.0.0-beta-3-SNAPSHOT");
+            in = new ReplaceStringInputStream(in, "1.1-SNAPSHOT", "1.0");
+            in = new ReplaceStringInputStream(in, "1.1-SNAPSHOT", "1.0");
+            in = new ReplaceStringInputStream(in, "0.0.1-SNAPSHOT", "1.0");

            update(file, in);
        }

Added:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/JiraReport.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/JiraReport.java?rev=1325623&view=auto
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/JiraReport.java
(added)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/JiraReport.java
Fri Apr 13 06:14:51 2012
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.openejb.tools.release.cmd;
+
+import org.apache.openejb.tools.release.Command;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Command
+public class JiraReport {
+    public static void main(String[] args) throws Throwable {
+        org.codehaus.swizzle.jirareport.Main.main(args);
+    }
+}

Added:
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/SnapshotfreeBuild.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/SnapshotfreeBuild.java?rev=1325623&view=auto
==============================================================================
---
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/SnapshotfreeBuild.java
(added)
+++
openejb/trunk/sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/SnapshotfreeBuild.java
Fri Apr 13 06:14:51 2012
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.openejb.tools.release.cmd;
+
+import org.apache.openejb.tools.release.Release;
+import org.apache.openejb.tools.release.util.Exec;
+import org.apache.openejb.tools.release.util.Files;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SnapshotfreeBuild {
+
+    public static void main(String... args) throws Exception {
+
+        // TODO Look for gpg on the path, report error if not found
+
+        final File home = new File(System.getProperty("user.home"));
+        final File repository = Files.file(home, ".m2", "repository",
"org", "apache", "openejb");
+
+        final List<File> snapshots = Files.collect(repository,
".*SNAPSHOT.*");
+        for (File snapshot : snapshots) {
+            if (!snapshot.isFile()) continue;
+            if (!snapshot.delete()) {
+                System.out.println("Cannot delete snapshot: " +
snapshot.getAbsolutePath());
+            }
+        }
+
+        final String branch = Release.branches +
Release.openejbVersionName;
+
+        final File dir = new File(Release.workdir);
+        Files.mkdir(dir);
+        Exec.cd(dir);
+
+        Exec.exec("svn", "co", branch);
+
+        Exec.cd(new File(dir + File.separator +
Release.openejbVersionName));
+
+        Exec.export("MAVEN_OPTS", Release.mavenOpts);
+        Exec.exec("mvn",
+                "-Dmaven.test.skip=true",
+                "-DfailIfNoTests=false",
+                "clean",
+                "install"
+        );
+    }
+}

Added: openejb/trunk/sandbox/release-tools/src/main/resources/recent.vm
URL:
http://svn.apache.org/viewvc/openejb/trunk/sandbox/release-tools/src/main/resources/recent.vm?rev=1325623&view=auto
==============================================================================
--- openejb/trunk/sandbox/release-tools/src/main/resources/recent.vm (added)
+++ openejb/trunk/sandbox/release-tools/src/main/resources/recent.vm Fri
Apr 13 06:14:51 2012
@@ -0,0 +1,13 @@
+#set( $void = $params.required( "username" , ".+", "the jira username" ) )
+#set( $void = $params.required( "password" , ".+", "the jira password" ) )
+#set( $void = $params.required( "project" , ".+", "the project key" ) )
+#set( $void = $params.validate() )
+##
+#set( $rpc = $xmlrpc.connect("${username}:${password}","
http://issues.apache.org/jira/rpc/xmlrpc";) )
+#set( $projectId = $rpc.getProject("${project}").id )
+#set ( $jira = $rss.fetch("
http://issues.apache.org/jira/secure/IssueNavigator.jspa?view=rss&&pid=${projectId}&tempMax=50&reset=true&decorator=none";)
)
+#set( $issues = $jira.issues.ascending("updated") )
+
+#foreach( $issue in $issues )
+$issue.key: $issue.summary
+#end

Reply via email to