You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2010/08/02 22:15:30 UTC
svn commit: r981670 - in /uima/uima-as/trunk/uimaj-as-core: ./
src/main/java/org/apache/uima/aae/ src/main/versionJava/
src/main/versionJava/org/ src/main/versionJava/org/apache/
src/main/versionJava/org/apache/uima/ src/main/versionJava/org/apache/uim...
Author: schor
Date: Mon Aug 2 20:15:29 2010
New Revision: 981670
URL: http://svn.apache.org/viewvc?rev=981670&view=rev
Log:
[UIMA-1834] added a new class, UimaVersion and UimaAsVersion, which is not in the source-path, and has substitutable values for the version (major, minor, incremental), and updated the pom to use filtered resource processing to produce a new class under target which has the version info from the pom substituted in.
Added:
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/
uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java
Removed:
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsVersion.java
Modified:
uima/uima-as/trunk/uimaj-as-core/pom.xml
Modified: uima/uima-as/trunk/uimaj-as-core/pom.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/pom.xml?rev=981670&r1=981669&r2=981670&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/pom.xml (original)
+++ uima/uima-as/trunk/uimaj-as-core/pom.xml Mon Aug 2 20:15:29 2010
@@ -83,6 +83,54 @@
</dependencies>
<build>
- <finalName>${project.artifactId}</finalName>
+ <finalName>${project.artifactId}</finalName>
+
+ <plugins>
+
+ <!-- filter the template for the version java code
+ to insert the version from properties -->
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4.3</version> <!-- 2.4.0 fails -->
+ <executions>
+ <execution>
+ <id>setVersions</id>
+ <goals><goal>copy-resources</goal></goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources/releaseVersion</outputDirectory>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/versionJava</directory>
+ </resource>
+ </resources>
+ <delimiters>
+ <delimiter>${*}</delimiter>
+ </delimiters>
+ <useDefaultDelimiters>false</useDefaultDelimiters>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- add the generated sources to the compile sources -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>addVersionSrc</id>
+ <goals><goal>add-source</goal></goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/releaseVersion</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
\ No newline at end of file
Added: uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java?rev=981670&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java (added)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java Mon Aug 2 20:15:29 2010
@@ -0,0 +1,58 @@
+/*
+ * 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.uima.aae;
+
+/**
+ * This class is used to define current UIMA AS version
+ *
+ */
+public class UimaAsVersion {
+
+ /**
+ * Gets the major version number of the UIMA AS implementation.
+ *
+ * @return the major version number
+ */
+ public short getMajorVersion() {
+ return ${parsedVersion.majorVersion}; // major version
+ }
+
+ /**
+ * Gets the minor version number of the UIMA AS implementation.
+ *
+ * @return the minor version number
+ */
+ public short getMinorVersion() {
+ return ${parsedVersion.minorVersion}; // minor version
+ }
+
+ /**
+ * Gets the build revision number of the UIMA AS implementation.
+ *
+ * @return the build revision number
+ */
+ public short getBuildRevision() {
+ return ${parsedVersion.incrementalVersion}; // build revision
+ }
+
+ public String getVersionString() {
+ return "" + getMajorVersion() + "." + getMinorVersion() + "." + getBuildRevision();
+ }
+}