Thomas Vachuska
Committed by Gerrit Code Review

Simplified app packaging to use just project.version rather than short.version.

Change-Id: I58c30b663810de42890b75bbcef5c7dc5a4a87ba
......@@ -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>
......
......@@ -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}">
......
......@@ -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>
......
......@@ -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}">
......
......@@ -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>
......
......@@ -63,27 +63,24 @@ public class OnosAppMojo extends AbstractMojo {
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 @@ public class OnosAppMojo extends AbstractMojo {
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 @@ public class OnosAppMojo extends AbstractMojo {
.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) {
......
......@@ -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>
......
......@@ -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}">
......