Sunday, June 9, 2013

Best place to buy twinings tea online

I'm a fan of twinings tea, but it's pretty pricey in the Toronto stores. Also, I can never find a pack of earl grey with more than 20.

After looking online I found out that walmart.ca is the best place to buy - free shipping and reasonable prices. Twinings.ca has it too but they charge for shipping.

Monday, April 8, 2013

Maven setup for uploading jar file to server

Here's some code I use for setting up a maven project that can create a single jar file and upload it to a server when you do mvn deploy. Just fill in the ... and <server> parts with the expected info..

Once it is done you can login to the server and just do a java -jar on the file.



 <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/xsd/maven-4.0.0.xsd">  
      <modelVersion>4.0.0</modelVersion>  
      <groupId>...</groupId>  
      <artifactId>...</artifactId>  
      <version>0.0.1-SNAPSHOT</version>  
      <dependencies>  
      ...  
      </dependencies>  
      <build>  
           <plugins>  
                <plugin>  
                     <artifactId>maven-assembly-plugin</artifactId>  
                     <version>2.4</version>  
                     <configuration>  
                          <descriptorRefs>  
                               <descriptorRef>jar-with-dependencies</descriptorRef>  
                          </descriptorRefs>  
                          <archive>  
                               <manifest>  
                                    <mainClass>...</mainClass>  
                               </manifest>  
                          </archive>  
                     </configuration>  
                     <executions>  
                          <execution>  
                               <id>make-assembly</id> <!-- this is used for inheritance merges -->  
                               <phase>package</phase> <!-- bind to the packaging phase -->  
                               <goals>  
                                    <goal>single</goal>  
                               </goals>  
                          </execution>  
                     </executions>  
                </plugin>  
                <plugin>  
                     <groupId>org.codehaus.mojo</groupId>  
                     <artifactId>wagon-maven-plugin</artifactId>  
                     <version>1.0-beta-4</version>  
                     <executions>  
                          <execution>  
                               <id>upload-javadoc</id>  
                               <phase>deploy</phase>  
                               <goals>  
                                    <goal>upload</goal>  
                               </goals>  
                               <configuration>  
                                    <fromDir>target</fromDir>  
                                    <includes>  
                                         *SNAPSHOT-jar-with-dependencies.jar  
                                    </includes>  
                                    <excludes>pom.xml</excludes>  
                                    <url>scpexe://<server></url>  
                                    <toDir>...</toDir>  
                               </configuration>  
                          </execution>  
                     </executions>  
                </plugin>  
                <!-- deploy only the jar with dependencies -->  
                <plugin>  
                     <groupId>org.apache.maven.plugins</groupId>  
                     <artifactId>maven-deploy-plugin</artifactId>  
                     <version>2.7</version>  
                     <configuration>  
                          <skip>true</skip>  
                     </configuration>  
                </plugin>  
           </plugins>  
           <extensions>  
                <extension>  
                     <groupId>org.apache.maven.wagon</groupId>  
                     <artifactId>wagon-ssh-external</artifactId>  
                     <version>1.0-beta-6</version>  
                </extension>  
           </extensions>  
      </build>  
      <distributionManagement>  
           <repository>  
                <id>ssh-repository</id>  
                <url>scpexe://...</url>  
           </repository>  
      </distributionManagement>  
 </project>