You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2015/10/17 00:46:36 UTC

svn commit: r1709124 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-common: ./ src/main/java/org/apache/uima/ducc/common/utils/ src/main/versionJava/ src/main/versionJava/org/ src/main/versionJava/org/apache/ src/main/versionJava/org/apache/uima/ src/mai...

Author: burn
Date: Fri Oct 16 22:46:35 2015
New Revision: 1709124

URL: http://svn.apache.org/viewvc?rev=1709124&view=rev
Log:
UIMA-4649 Make Version.java return the version defined in the pom

Added:
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java   (with props)
Removed:
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/utils/Version.java
Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/pom.xml

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/pom.xml
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/pom.xml?rev=1709124&r1=1709123&r2=1709124&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/pom.xml (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/pom.xml Fri Oct 16 22:46:35 2015
@@ -130,5 +130,55 @@
 
   </dependencies>
 
+  <build>
+	<finalName>${project.artifactId}-${project.version}</finalName>
+    <plugins>
+      <!-- filter the template for the version java code
+           to insert the version from properties -->
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <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>
+        <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>
 	

Added: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java?rev=1709124&view=auto
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java (added)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java Fri Oct 16 22:46:35 2015
@@ -0,0 +1,52 @@
+/*
+ * 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.ducc.common.utils;
+
+/**
+ * The source for this class is located in 
+ *   src/main/versionJava/org/apache/uima/ducc/common/utils
+ *   
+ * It is processed at build time to create a java source, by substituting
+ * values from the build into some fields.
+ *   The Java source is put into target/generated-sources/releaseVersion
+ *     in the package org.apache.uima.ducc.common.utils
+ *
+ */
+
+public class Version
+{
+    private static final String fullVersion = "${project.version}";
+    
+    public final static String version()
+    {
+        return fullVersion;
+    }
+    
+    /*
+     * This version number is included on each CLI request and checked by DUCC.
+     * Change the value when requests are changed in an incompatible way.
+     */
+    public final static int cliVersion = 1;
+
+    public static void main(String[] args)
+    {
+        System.out.println(version());
+    }
+
+}

Propchange: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/versionJava/org/apache/uima/ducc/common/utils/Version.java
------------------------------------------------------------------------------
    svn:eol-style = native