Thread: [Squirrel-sql-commits] SF.net SVN: squirrel-sql:[5973] trunk/maven-plugin-workspace/ squirrelsql-u
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Revision: 5973 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5973&view=rev Author: manningr Date: 2010-11-20 02:08:52 +0000 (Sat, 20 Nov 2010) Log Message: ----------- Make this mojo thread safe. Since this mojo works with an external file which is essentially shared state, two concurrent threads could be problematic. So execute is synchronized. This mojo typically is only ever used once during a build, so it is technically not necessary to do this; better to be safe than sorry. Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2010-11-20 01:17:09 UTC (rev 5972) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2010-11-20 02:08:52 UTC (rev 5973) @@ -46,6 +46,7 @@ * * @goal build-update-site * @phase package + * @threadSafe */ public class BuildUpdateSiteMojo extends AbstractMojo { @@ -103,7 +104,7 @@ * @throws MojoExecutionException * if the releaseDirectory isn't specified, doesn't exist or cannot be read. */ - public void execute() throws MojoExecutionException + synchronized public void execute() throws MojoExecutionException { String channelName = "snapshot"; String releaseName = "snapshot"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 6136 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6136&view=rev Author: manningr Date: 2011-01-08 22:59:32 +0000 (Sat, 08 Jan 2011) Log Message: ----------- 3153349: added step to copy the assembly archive files to the old format. Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-01-08 16:53:25 UTC (rev 6135) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-01-08 22:59:32 UTC (rev 6136) @@ -22,10 +22,6 @@ import java.io.File; import java.io.IOException; import java.util.Date; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; import net.sourceforge.squirrel_sql.client.update.UpdateUtil; import net.sourceforge.squirrel_sql.client.update.xmlbeans.ArtifactXmlBean; @@ -34,7 +30,9 @@ import net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean; import net.sourceforge.squirrel_sql.client.update.xmlbeans.UpdateXmlSerializer; import net.sourceforge.squirrel_sql.client.update.xmlbeans.UpdateXmlSerializerImpl; -import net.sourceforge.squirrel_sql.client.update.xmlbeans.XmlBeanUtilities; +import net.sourceforge.squirrel_sql.fw.util.FileWrapper; +import net.sourceforge.squirrel_sql.fw.util.FileWrapperFactory; +import net.sourceforge.squirrel_sql.fw.util.FileWrapperFactoryImpl; import net.sourceforge.squirrel_sql.fw.util.IOUtilities; import net.sourceforge.squirrel_sql.fw.util.IOUtilitiesImpl; @@ -54,6 +52,8 @@ private org.apache.maven.plugin.logging.Log log = getLog(); private IOUtilities _iou = new IOUtilitiesImpl(); + + private FileWrapperFactory _fileWrapperFactory = new FileWrapperFactoryImpl(); /** * Transitive dependencies that are not used directly by SQuirreL are excluded so that the update site @@ -126,6 +126,7 @@ try { + copyPluginAssemblies(); ChannelXmlBean channelBean = buildChannelRelease(channelName, releaseName, releaseVersion, releaseDir.getAbsolutePath()); UpdateXmlSerializer serializer = new UpdateXmlSerializerImpl(); @@ -200,6 +201,36 @@ } /** + * In order for versions older than 3.2.1 to be properly upgraded, the plugin assmebly files that have the + * form : + * + * <pre> + * <plugin internal name>-assembly.zip + * </pre> + * + * must be copied to the old archive form : + * + * <pre> + * <plugin internal name>.zip + * </pre> + * + * This method loops through all of the plugin assembly archives and copies them to the old format. + */ + private void copyPluginAssemblies() throws IOException { + FileWrapper pluginsDir = _fileWrapperFactory.create(releaseDirectory, "plugin"); + String[] pluginsList = pluginsDir.list(); + for (String plugin : pluginsList) { + String oldFormat = plugin.replace("-assembly", ""); + FileWrapper pluginAssemblyArchiveFile = _fileWrapperFactory.create(pluginsDir, plugin); + FileWrapper oldFormatArchiveFile = _fileWrapperFactory.create(pluginsDir, oldFormat); + if (log.isInfoEnabled()) { + log.info("Copying assembly file ( "+plugin+" ) to old format: "+oldFormat); + } + _iou.copyFile(pluginAssemblyArchiveFile, oldFormatArchiveFile); + } + } + + /** * Searches for the specified filename in the excludedPatterns array and compares to see if any pattern * matches. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 6233 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6233&view=rev Author: manningr Date: 2011-04-09 22:53:45 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Versions of SQuirrel built with Ant expected plugin artifacts to be named with the format <internal name>.jar, instead of what Maven produces, which is <internal name>-assembly.zip. Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-04-06 06:31:45 UTC (rev 6232) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-04-09 22:53:45 UTC (rev 6233) @@ -211,7 +211,7 @@ * must be copied to the old archive form : * * <pre> - * <plugin internal name>.zip + * <plugin internal name>.jar * </pre> * * This method loops through all of the plugin assembly archives and copies them to the old format. @@ -220,7 +220,7 @@ FileWrapper pluginsDir = _fileWrapperFactory.create(releaseDirectory, "plugin"); String[] pluginsList = pluginsDir.list(); for (String plugin : pluginsList) { - String oldFormat = plugin.replace("-assembly", ""); + String oldFormat = plugin.replace("-assembly", "").replace(".zip", ".jar"); FileWrapper pluginAssemblyArchiveFile = _fileWrapperFactory.create(pluginsDir, plugin); FileWrapper oldFormatArchiveFile = _fileWrapperFactory.create(pluginsDir, oldFormat); if (log.isInfoEnabled()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 6248 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6248&view=rev Author: manningr Date: 2011-05-08 22:56:38 +0000 (Sun, 08 May 2011) Log Message: ----------- Removed from the excluded artifacts list those artifacts that could possibly be required for running SQuirreL. Now the list contains only build-related artifacts that should never appear in the update site by dependency resolution anyway. Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-04-28 19:43:17 UTC (rev 6247) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-05-08 22:56:38 UTC (rev 6248) @@ -65,12 +65,9 @@ * release directory that match any pattern in this list will not be included and will also be deleted. */ private static final String[] excludedPatterns = - new String[] { "maven", "plexus", "ant.jar", "ant-", "aopalliance", "axis", "classworlds", - "commons-beanutils", "commons-digester", "commons-lang", "commons-validator", "doxia", "ehcache", - "file-management", "tests", "hibernate-validator", "ilf-gpl", "javassist", "jboss", "jsch", - "jtidy", "junit", "kunststoff", "looks", "metouia", "napkinlaf", "nimrodlf", "oalnf", "oro.jar", - "persistence.jar", "skinlf", "squirrelsql-translations", "substance", "swingsetthemes", - "tinylaf", "toniclf", "velocity", "wagon", "xml-apis" }; + new String[] { + "maven", "plexus", "ant.jar", "ant-", "classworlds", "tests" + }; /** * Location of the directory which contains the release artifacts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 6464 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6464&view=rev Author: manningr Date: 2011-10-30 17:15:53 +0000 (Sun, 30 Oct 2011) Log Message: ----------- Update to produce a batch file containing file transfer commands that are necessary for using sftp. The file that gets produced is target/batch.txt Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-10-29 00:04:13 UTC (rev 6463) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-10-30 17:15:53 UTC (rev 6464) @@ -20,7 +20,9 @@ */ import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; +import java.io.PrintWriter; import java.util.Date; import net.sourceforge.squirrel_sql.client.update.UpdateUtil; @@ -94,6 +96,19 @@ { this.releaseVersion = releaseVersion; } + + /** + * The path to the root of the update site on the server + * + * @parameter expression="${updateSitePath}" + * @required + */ + private String updateSitePath; + + public void setUpdateSitePath(String updateSitePath) + { + this.updateSitePath = updateSitePath; + } /** * Does the main work provided by this plugin. @@ -159,6 +174,7 @@ private ChannelXmlBean buildChannelRelease(String channelName, String releaseName, String version, String directory) throws IOException { + final PrintWriter batchFileWriter = getBatchFileWriter(releaseName); ChannelXmlBean result = new ChannelXmlBean(); result.setName(channelName); ReleaseXmlBean releaseBean = new ReleaseXmlBean(releaseName, version); @@ -172,6 +188,7 @@ // f is a module ModuleXmlBean module = new ModuleXmlBean(); module.setName(f.getName()); + batchFileWriter.println(getCdModulePathOnServer(releaseName, module.getName())); for (File a : f.listFiles()) { String filename = a.getName(); if (isExcluded(filename)) { @@ -181,6 +198,7 @@ if (log.isDebugEnabled()) { log.debug("Processing artifact file: " + filename); } + batchFileWriter.println("put target/release/"+module.getName()+"/"+filename); String type = filename.substring(filename.indexOf(".") + 1); ArtifactXmlBean artifact = new ArtifactXmlBean(); artifact.setName(a.getName()); @@ -193,6 +211,7 @@ releaseBean.addmodule(module); } } + batchFileWriter.close(); result.setCurrentRelease(releaseBean); return result; } @@ -250,4 +269,23 @@ } return result; } + + private PrintWriter getBatchFileWriter(String releaseName) throws FileNotFoundException { + PrintWriter result = new PrintWriter("target/batch.txt"); + result.println(getCdModulePathOnServer(releaseName, null)); + result.println("put target/release/release.xml"); + return result; + } + + private String getCdModulePathOnServer(String releaseName, String moduleName) { + StringBuilder result = new StringBuilder("cd "); + result.append(updateSitePath); + result.append("/"); + result.append(releaseName); + if (moduleName != null) { + result.append("/"); + result.append(moduleName); + } + return result.toString(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 6467 http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6467&view=rev Author: manningr Date: 2011-10-30 20:02:16 +0000 (Sun, 30 Oct 2011) Log Message: ----------- Manually resolve the basedir of the project. This prevents a bug that occurs when the plugin is run as part of a childs build in a parent's reactor build and basedir in that case is the parent's, not the child's. Modified Paths: -------------- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java Modified: trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java =================================================================== --- trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-10-30 18:14:41 UTC (rev 6466) +++ trunk/maven-plugin-workspace/squirrelsql-update-site-plugin/src/main/java/net/sf/squirrel_sql/BuildUpdateSiteMojo.java 2011-10-30 20:02:16 UTC (rev 6467) @@ -40,6 +40,7 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.project.MavenProject; /** * Goal which builds the update site from a directory which is specified as an argument. @@ -109,6 +110,13 @@ { this.updateSitePath = updateSitePath; } + + /** + * @parameter default-value="${project}" + * @required + * @readonly + */ + private MavenProject project; /** * Does the main work provided by this plugin. @@ -271,7 +279,7 @@ } private PrintWriter getBatchFileWriter(String releaseName) throws FileNotFoundException { - PrintWriter result = new PrintWriter("target/batch.txt"); + PrintWriter result = new PrintWriter(project.getBasedir()+"/target/batch.txt"); result.println(getCdModulePathOnServer(releaseName, null)); result.println("put target/release/release.xml"); return result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |