/*
 * Copyright 2006-2007 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.
 */

package org.openspaces.maven.support;

import com.j_spaces.kernel.PlatformVersion;

/**
 * @author kimchy
 */
public class OutputVersion {

    public static String computeVersion() {
        if (PlatformVersion.getMilestone().equals("GA")) {
            return PlatformVersion.getVersion();
        } else {
            return PlatformVersion.getVersion() + "-" + PlatformVersion.getMilestone() + "-" + PlatformVersion.getBuildNumber();
        }
    }
    
    public static void main(String[] args) throws Exception {
        System.out.println(computeVersion());
    }
}

@@ -703,16 +703,305 @@
 n;%0A%0A/**%0A
+ * Outputs the version to use with Maven. Following the following rules:%0A *%0A * 1. It this is GA, then just 6.5 will be used.%0A * 2. If this is a final milestone, then 6.5-%5Bmilestone%5D will be used.%0A * 3. If this is an internal milestone, then 6.5-%5Bmilestone%5D-%5Bbuild number%5D will be used.%0A *%0A
  * @auth
@@ -1010,16 +1010,16 @@
  kimchy%0A
-
  */%0Apubl
@@ -1192,24 +1192,186 @@
 tVersion();%0A
+        %7D else if (PlatformVersion.getBuildNumber().indexOf(%22-%22) == -1) %7B%0A            return PlatformVersion.getVersion() + %22-%22 + PlatformVersion.getMilestone();%0A
         %7D el
@@ -1520,20 +1520,16 @@
 %7D%0A    %7D%0A
-    
 %0A    pub

improve the version we generate for maven