/[schmitzm]/trunk/src/skrueger/versionnumber/ReleaseUtil.java
ViewVC logotype

Diff of /trunk/src/skrueger/versionnumber/ReleaseUtil.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 813 by alfonx, Thu Apr 22 00:08:48 2010 UTC revision 1111 by alfonx, Thu Oct 14 18:28:28 2010 UTC
# Line 21  import org.apache.log4j.Logger; Line 21  import org.apache.log4j.Logger;
21   *   *
22   * <br/>   * <br/>
23   *         1. pom.xml anpassen: <code>   *         1. pom.xml anpassen: <code>
24                          <plugin>                                          <plugin>
25                                  <groupId>org.codehaus.mojo</groupId>                                  <groupId>org.codehaus.mojo</groupId>
26                                  <artifactId>buildnumber-maven-plugin</artifactId>                                  <artifactId>buildnumber-maven-plugin</artifactId>
27                                  <version>1.0-beta-4</version>                                  <version>1.0-beta-4</version>
# Line 35  import org.apache.log4j.Logger; Line 35  import org.apache.log4j.Logger;
35                                          </execution>                                          </execution>
36                                  </executions>                                  </executions>
37                                  <configuration>                                  <configuration>
38                                                                            <!-- <doCheck>false</doCheck> <doUpdate>false</doUpdate> <providerImplementations>
39                                          <doCheck>false</doCheck>                                                  <svn>javasvn</svn> </providerImplementations> -->
40                                          <doUpdate>false</doUpdate>                                          <format>{0,date,yyyyMMddHHmm}</format>
41                                          <providerImplementations>                                          <items>
42                                                  <svn>javasvn</svn>                                                  <item>timestamp</item>
43                                          </providerImplementations>                                          </items>
44                                  </configuration>                                  </configuration>
45                          </plugin>                          </plugin>
46                  </code><br/>                  </code><br/>
# Line 95  public class ReleaseUtil { Line 95  public class ReleaseUtil {
95           *           *
96           * @Return the major part of the software version or 0 if a problem occurs.           * @Return the major part of the software version or 0 if a problem occurs.
97           */           */
98          public static int getVersionBuild(Class<?> clazz) {          public static String getVersionBuild(Class<?> clazz) {
99                  try {                  try {
100                          final URL releasePropsURL = clazz                          final URL releasePropsURL = clazz
101                                          .getResource("/release.properties");                                          .getResource("/release.properties");
# Line 112  public class ReleaseUtil { Line 112  public class ReleaseUtil {
112                          if (str.equals("${buildNumber}")) {                          if (str.equals("${buildNumber}")) {
113                                  // We are in development or Maven didn't filter the properties                                  // We are in development or Maven didn't filter the properties
114                                  // while building.                                  // while building.
115                                  return 0;                                  return "0";
116                          }                          }
117    
118                          return Integer.parseInt(str);                          return str;
119                  } catch (final Exception e) {                  } catch (final Exception e) {
120                          log.error("/release.properties could not be read from "                          log.error("/release.properties could not be read from "
121                                          + clazz.getSimpleName(), e);                                          + clazz.getSimpleName(), e);
122                          return 0;                          return "0";
123                  }                  }
124    
125          }          }

Legend:
Removed from v.813  
changed lines
  Added in v.1111

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26