Revision: 5673
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5673&view=rev
Author: manningr
Date: 2010-07-08 10:21:05 +0000 (Thu, 08 Jul 2010)
Log Message:
-----------
Fixed compile errors.
Modified Paths:
--------------
trunk/mavenize/squirrelsql-version-plugin/pom.xml
trunk/mavenize/squirrelsql-version-plugin/src/main/java/net/sf/squirrel_sql/SquirrelSqlVersionMojo.java
Modified: trunk/mavenize/squirrelsql-version-plugin/pom.xml
===================================================================
--- trunk/mavenize/squirrelsql-version-plugin/pom.xml 2010-07-08 10:10:39 UTC (rev 5672)
+++ trunk/mavenize/squirrelsql-version-plugin/pom.xml 2010-07-08 10:21:05 UTC (rev 5673)
@@ -1,20 +1,19 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>net.sf.squirrel-sql</groupId>
- <artifactId>squirrel-root-pom</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </parent>
-
- <groupId>net.sf.squirrel-sql</groupId>
- <artifactId>squirrelsql-version-plugin</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
-
- <name>SQuirreLSQL Version Maven Mojo</name>
- <description>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-root-pom</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrelsql-version-plugin</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+ <name>SQuirreLSQL Version Maven Mojo</name>
+ <description>
This project produces a maven mojo that can set the System property "squirrelsql.version" so that
it can be used globally by the installers and the update-site projects. It accepts the project
version as an argument which it uses to decide what the squirrelsql.version should be. If the
@@ -23,70 +22,77 @@
however, the project version does not end with "-SNAPSHOT", then squirrelsql.version will be set to
the value of the project version.
</description>
-
- <inceptionYear>2001</inceptionYear>
- <developers>
- <developer>
- <name>Gerd Wagner</name>
- <roles>
- <role>Administrator</role>
- <role>Developer</role>
- </roles>
- </developer>
- <developer>
- <name>Rob Manning</name>
- <roles>
- <role>Developer</role>
- <role>Release Manager</role>
- </roles>
- </developer>
- </developers>
- <licenses>
- <license>
- <name>GNU Lesser</name>
- <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- <url>http://www.squirrelsql.org/</url>
- <scm>
- <connection>scm:svn:https://squirrel-sql.svn.sourceforge.net/svnroot/squirrel-sql/trunk/sql12/</connection>
- <developerConnection>scm:svn:http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</developerConnection>
- <url>http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</url>
- </scm>
- <issueManagement>
- <system>SourceForge Tracker</system>
- <url>http://sourceforge.net/tracker/?group_id=28383%26atid=393414</url>
- </issueManagement>
- <ciManagement>
- <system>Hudson</system>
- <url>https://www.squirrel-sql.org/hudson/</url>
- </ciManagement>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>squirrel-sql</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${maven-plugin-api-version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
- <source>${javac-source-version}</source>
- <target>${javac-target-version}</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <inceptionYear>2001</inceptionYear>
+ <developers>
+ <developer>
+ <name>Gerd Wagner</name>
+ <roles>
+ <role>Administrator</role>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Rob Manning</name>
+ <roles>
+ <role>Developer</role>
+ <role>Release Manager</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>GNU Lesser</name>
+ <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <url>http://www.squirrelsql.org/</url>
+ <scm>
+ <connection>scm:svn:https://squirrel-sql.svn.sourceforge.net/svnroot/squirrel-sql/trunk/sql12/</connection>
+ <developerConnection>scm:svn:http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</developerConnection>
+ <url>http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</url>
+ </scm>
+ <issueManagement>
+ <system>SourceForge Tracker</system>
+ <url>http://sourceforge.net/tracker/?group_id=28383%26atid=393414</url>
+ </issueManagement>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>https://www.squirrel-sql.org/hudson/</url>
+ </ciManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven-plugin-api-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings</artifactId>
+ <version>2.0.2</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
+ <source>${javac-source-version}</source>
+ <target>${javac-target-version}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/mavenize/squirrelsql-version-plugin/src/main/java/net/sf/squirrel_sql/SquirrelSqlVersionMojo.java
===================================================================
--- trunk/mavenize/squirrelsql-version-plugin/src/main/java/net/sf/squirrel_sql/SquirrelSqlVersionMojo.java 2010-07-08 10:10:39 UTC (rev 5672)
+++ trunk/mavenize/squirrelsql-version-plugin/src/main/java/net/sf/squirrel_sql/SquirrelSqlVersionMojo.java 2010-07-08 10:21:05 UTC (rev 5673)
@@ -21,9 +21,11 @@
import java.io.File;
import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
import java.util.Map.Entry;
@@ -40,6 +42,7 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
/**
* Goal which sets the System property "squirrelsql.version" based on the value of project version. Sets the
@@ -62,6 +65,15 @@
public static String VERSION_PROPERTY_KEY = "squirrelsql.version";
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
/**
* The version for the release.
*
@@ -86,10 +98,11 @@
if (projectVersion == null) { throw new MojoExecutionException("projectVersion cannot be null."); }
String squirrelsqlVersion = projectVersion;
+ String timestampPattern = "yyyyMMdd_kkmm";
if (!projectVersion.toLowerCase().endsWith("-snapshot"))
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_kkmm");
+ SimpleDateFormat sdf = new SimpleDateFormat(timestampPattern);
try
{
String date = sdf.format(new Date());
@@ -97,6 +110,7 @@
}
catch (IllegalStateException e)
{
+
log.error("Could not convert date format pattern " + timestampPattern);
throw e;
}
@@ -104,7 +118,7 @@
Properties props = project.getProperties();
props.put(VERSION_PROPERTY_KEY, squirrelsqlVersion);
- System.setProperty(VERSION_PROPERTY_KEY, squirrelsqlVersion)
+ System.setProperty(VERSION_PROPERTY_KEY, squirrelsqlVersion);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|