Committed by
Gerrit Code Review
Simplified app packaging to use just project.version rather than short.version.
Change-Id: I58c30b663810de42890b75bbcef5c7dc5a4a87ba
Showing
8 changed files
with
10 additions
and
15 deletions
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${short.version}" | 17 | +<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}" |
| 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" | 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" |
| 19 | features="${project.artifactId}"> | 19 | features="${project.artifactId}"> |
| 20 | <description>${project.description}</description> | 20 | <description>${project.description}</description> | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}"> | 17 | +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}"> |
| 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> | 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> |
| 19 | <feature name="${project.artifactId}" version="${project.version}" | 19 | <feature name="${project.artifactId}" version="${project.version}" |
| 20 | description="${project.description}"> | 20 | description="${project.description}"> | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<app name="org.onosproject.sdnip" origin="ON.Lab" version="${short.version}" | 17 | +<app name="org.onosproject.sdnip" origin="ON.Lab" version="${project.version}" |
| 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" | 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" |
| 19 | features="${project.artifactId}"> | 19 | features="${project.artifactId}"> |
| 20 | <description>${project.description}</description> | 20 | <description>${project.description}</description> | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}"> | 17 | +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}"> |
| 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> | 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> |
| 19 | <feature name="onos-app-sdnip" version="${project.version}" | 19 | <feature name="onos-app-sdnip" version="${project.version}" |
| 20 | description="${project.description}"> | 20 | description="${project.description}"> | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<app name="org.onosproject.openflow" origin="ON.Lab" version="${short.version}" | 17 | +<app name="org.onosproject.openflow" origin="ON.Lab" version="${project.version}" |
| 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" | 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" |
| 19 | features="${project.artifactId}"> | 19 | features="${project.artifactId}"> |
| 20 | <description>${project.description}</description> | 20 | <description>${project.description}</description> | ... | ... |
| ... | @@ -63,27 +63,24 @@ public class OnosAppMojo extends AbstractMojo { | ... | @@ -63,27 +63,24 @@ public class OnosAppMojo extends AbstractMojo { |
| 63 | private static final String ONOS_APP_NAME = "onos.app.name"; | 63 | private static final String ONOS_APP_NAME = "onos.app.name"; |
| 64 | private static final String ONOS_APP_ORIGIN = "onos.app.origin"; | 64 | private static final String ONOS_APP_ORIGIN = "onos.app.origin"; |
| 65 | 65 | ||
| 66 | - private static final String SNAPSHOT = "-SNAPSHOT"; | ||
| 67 | - | ||
| 68 | private static final String JAR = "jar"; | 66 | private static final String JAR = "jar"; |
| 69 | private static final String XML = "xml"; | 67 | private static final String XML = "xml"; |
| 70 | private static final String APP_ZIP = "oar"; | 68 | private static final String APP_ZIP = "oar"; |
| 71 | private static final String PACKAGE_DIR = "oar"; | 69 | private static final String PACKAGE_DIR = "oar"; |
| 72 | 70 | ||
| 73 | private static final String DEFAULT_ORIGIN = "ON.Lab"; | 71 | private static final String DEFAULT_ORIGIN = "ON.Lab"; |
| 74 | - private static final String DEFAULT_VERSION = "${short.version}"; | 72 | + private static final String DEFAULT_VERSION = "${project.version}"; |
| 75 | 73 | ||
| 76 | private static final String DEFAULT_FEATURES_REPO = | 74 | private static final String DEFAULT_FEATURES_REPO = |
| 77 | "mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"; | 75 | "mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"; |
| 78 | private static final String DEFAULT_ARTIFACT = | 76 | private static final String DEFAULT_ARTIFACT = |
| 79 | "mvn:${project.groupId}/${project.artifactId}/${project.version}"; | 77 | "mvn:${project.groupId}/${project.artifactId}/${project.version}"; |
| 80 | 78 | ||
| 81 | - private static final int BUFFER_ZIZE = 8192; | 79 | + private static final int BUFFER_SIZE = 8192; |
| 82 | 80 | ||
| 83 | private String name; | 81 | private String name; |
| 84 | private String origin; | 82 | private String origin; |
| 85 | private String version = DEFAULT_VERSION; | 83 | private String version = DEFAULT_VERSION; |
| 86 | - private String shortVersion; | ||
| 87 | private String featuresRepo = DEFAULT_FEATURES_REPO; | 84 | private String featuresRepo = DEFAULT_FEATURES_REPO; |
| 88 | private List<String> artifacts; | 85 | private List<String> artifacts; |
| 89 | 86 | ||
| ... | @@ -158,7 +155,6 @@ public class OnosAppMojo extends AbstractMojo { | ... | @@ -158,7 +155,6 @@ public class OnosAppMojo extends AbstractMojo { |
| 158 | 155 | ||
| 159 | m2Directory = new File(localRepository.getBasedir()); | 156 | m2Directory = new File(localRepository.getBasedir()); |
| 160 | stageDirectory = new File(dstDirectory, PACKAGE_DIR); | 157 | stageDirectory = new File(dstDirectory, PACKAGE_DIR); |
| 161 | - shortVersion = projectVersion.replace(SNAPSHOT, ""); | ||
| 162 | projectPath = M2_PREFIX + "/" + artifactDir(projectGroupId, projectArtifactId, projectVersion); | 158 | projectPath = M2_PREFIX + "/" + artifactDir(projectGroupId, projectArtifactId, projectVersion); |
| 163 | 159 | ||
| 164 | origin = (String) project.getProperties().get(ONOS_APP_ORIGIN); | 160 | origin = (String) project.getProperties().get(ONOS_APP_ORIGIN); |
| ... | @@ -345,14 +341,13 @@ public class OnosAppMojo extends AbstractMojo { | ... | @@ -345,14 +341,13 @@ public class OnosAppMojo extends AbstractMojo { |
| 345 | .replaceAll("\\$\\{project.groupId\\}", projectGroupId) | 341 | .replaceAll("\\$\\{project.groupId\\}", projectGroupId) |
| 346 | .replaceAll("\\$\\{project.artifactId\\}", projectArtifactId) | 342 | .replaceAll("\\$\\{project.artifactId\\}", projectArtifactId) |
| 347 | .replaceAll("\\$\\{project.version\\}", projectVersion) | 343 | .replaceAll("\\$\\{project.version\\}", projectVersion) |
| 348 | - .replaceAll("\\$\\{short.version\\}", shortVersion) | ||
| 349 | .replaceAll("\\$\\{project.description\\}", projectDescription); | 344 | .replaceAll("\\$\\{project.description\\}", projectDescription); |
| 350 | } | 345 | } |
| 351 | 346 | ||
| 352 | // Recursively archives the specified directory into a given ZIP stream. | 347 | // Recursively archives the specified directory into a given ZIP stream. |
| 353 | private void zipDirectory(String root, File dir, ZipOutputStream zos) | 348 | private void zipDirectory(String root, File dir, ZipOutputStream zos) |
| 354 | throws IOException { | 349 | throws IOException { |
| 355 | - byte[] buffer = new byte[BUFFER_ZIZE]; | 350 | + byte[] buffer = new byte[BUFFER_SIZE]; |
| 356 | File[] files = dir.listFiles(); | 351 | File[] files = dir.listFiles(); |
| 357 | if (files != null && files.length > 0) { | 352 | if (files != null && files.length > 0) { |
| 358 | for (File file : files) { | 353 | for (File file : files) { | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<app name="${onos.app.name}" origin="${onos.app.origin}" version="${short.version}" | 17 | +<app name="${onos.app.name}" origin="${onos.app.origin}" version="${project.version}" |
| 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" | 18 | featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" |
| 19 | features="${project.artifactId}"> | 19 | features="${project.artifactId}"> |
| 20 | <description>${project.description}</description> | 20 | <description>${project.description}</description> | ... | ... |
| ... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
| 14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
| 16 | --> | 16 | --> |
| 17 | -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${short.version}"> | 17 | +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}"> |
| 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> | 18 | <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository> |
| 19 | <feature name="${project.artifactId}" version="${project.version}" | 19 | <feature name="${project.artifactId}" version="${project.version}" |
| 20 | description="${project.description}"> | 20 | description="${project.description}"> | ... | ... |
-
Please register or login to post a comment