Simplified app packaging to use just project.version rather than short.version.
Change-Id: I58c30b663810de42890b75bbcef5c7dc5a4a87ba
diff --git a/apps/bgprouter/app.xml b/apps/bgprouter/app.xml
index d4cd0f5..c85e469 100644
--- a/apps/bgprouter/app.xml
+++ b/apps/bgprouter/app.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${short.version}"
+<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}">
<description>${project.description}</description>
diff --git a/apps/bgprouter/features.xml b/apps/bgprouter/features.xml
index 3b80318..3457321 100644
--- a/apps/bgprouter/features.xml
+++ b/apps/bgprouter/features.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}">
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
<repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
<feature name="${project.artifactId}" version="${project.version}"
description="${project.description}">
diff --git a/apps/sdnip/app.xml b/apps/sdnip/app.xml
index 8437ae1..7aafa6a 100644
--- a/apps/sdnip/app.xml
+++ b/apps/sdnip/app.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<app name="org.onosproject.sdnip" origin="ON.Lab" version="${short.version}"
+<app name="org.onosproject.sdnip" origin="ON.Lab" version="${project.version}"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}">
<description>${project.description}</description>
diff --git a/apps/sdnip/features.xml b/apps/sdnip/features.xml
index 4125a67..f314770 100644
--- a/apps/sdnip/features.xml
+++ b/apps/sdnip/features.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}">
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
<repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
<feature name="onos-app-sdnip" version="${project.version}"
description="${project.description}">
diff --git a/providers/openflow/app/app.xml b/providers/openflow/app/app.xml
index f1b31b6..1bd209e 100644
--- a/providers/openflow/app/app.xml
+++ b/providers/openflow/app/app.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<app name="org.onosproject.openflow" origin="ON.Lab" version="${short.version}"
+<app name="org.onosproject.openflow" origin="ON.Lab" version="${project.version}"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}">
<description>${project.description}</description>
diff --git a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosAppMojo.java b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosAppMojo.java
index 6865ccf..bfc6127 100644
--- a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosAppMojo.java
+++ b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosAppMojo.java
@@ -63,27 +63,24 @@
private static final String ONOS_APP_NAME = "onos.app.name";
private static final String ONOS_APP_ORIGIN = "onos.app.origin";
- private static final String SNAPSHOT = "-SNAPSHOT";
-
private static final String JAR = "jar";
private static final String XML = "xml";
private static final String APP_ZIP = "oar";
private static final String PACKAGE_DIR = "oar";
private static final String DEFAULT_ORIGIN = "ON.Lab";
- private static final String DEFAULT_VERSION = "${short.version}";
+ private static final String DEFAULT_VERSION = "${project.version}";
private static final String DEFAULT_FEATURES_REPO =
"mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features";
private static final String DEFAULT_ARTIFACT =
"mvn:${project.groupId}/${project.artifactId}/${project.version}";
- private static final int BUFFER_ZIZE = 8192;
+ private static final int BUFFER_SIZE = 8192;
private String name;
private String origin;
private String version = DEFAULT_VERSION;
- private String shortVersion;
private String featuresRepo = DEFAULT_FEATURES_REPO;
private List<String> artifacts;
@@ -158,7 +155,6 @@
m2Directory = new File(localRepository.getBasedir());
stageDirectory = new File(dstDirectory, PACKAGE_DIR);
- shortVersion = projectVersion.replace(SNAPSHOT, "");
projectPath = M2_PREFIX + "/" + artifactDir(projectGroupId, projectArtifactId, projectVersion);
origin = (String) project.getProperties().get(ONOS_APP_ORIGIN);
@@ -345,14 +341,13 @@
.replaceAll("\\$\\{project.groupId\\}", projectGroupId)
.replaceAll("\\$\\{project.artifactId\\}", projectArtifactId)
.replaceAll("\\$\\{project.version\\}", projectVersion)
- .replaceAll("\\$\\{short.version\\}", shortVersion)
.replaceAll("\\$\\{project.description\\}", projectDescription);
}
// Recursively archives the specified directory into a given ZIP stream.
private void zipDirectory(String root, File dir, ZipOutputStream zos)
throws IOException {
- byte[] buffer = new byte[BUFFER_ZIZE];
+ byte[] buffer = new byte[BUFFER_SIZE];
File[] files = dir.listFiles();
if (files != null && files.length > 0) {
for (File file : files) {
diff --git a/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/app.xml b/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/app.xml
index 4c4399c..0f3133d 100644
--- a/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/app.xml
+++ b/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/app.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<app name="${onos.app.name}" origin="${onos.app.origin}" version="${short.version}"
+<app name="${onos.app.name}" origin="${onos.app.origin}" version="${project.version}"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}">
<description>${project.description}</description>
diff --git a/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/features.xml b/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/features.xml
index 1e85dbb..d5a91e2 100644
--- a/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/features.xml
+++ b/tools/package/maven-plugin/src/main/resources/org/onosproject/maven/features.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}">
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
<repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
<feature name="${project.artifactId}" version="${project.version}"
description="${project.description}">