Showing posts with label move. Show all posts
Showing posts with label move. Show all posts

Thursday, December 15, 2011

Move Git repository from Unfuddle to BitBucket

Saturday, March 19, 2011

Idea Day: Scan for shared webapp dependencies and move them to the common/lib folder

Welcome to Idea Day!
It is 6:43 AM on 3/19/2011 and its a Saturday.
Lets get cracking :)

Google search for "tomcat scan detect common jars" yielded some reading material for starters - jar-scanner and loader - but both these seemed to be get kicked-off per web-application whereas something more global is required to move jars around and thin the pack before web applications are considered at all.

Let us break-down the process:
  1. Tomcat starts
  2. Hook-in at the point where we have a list of the docBase attribute for all the web applications that will be hosted by this tomcat instance. And none of the web application specific handling has begun yet.
    1. Loop over each ${docBase}/WEB-INF/lib folder and make a list of common jars.
    2. Try to decide "commonality" based on a combination of the following factors:
      • start by doing a fuzzy match on the file name
      • then try to match the jar version in the names or if you can find it by introspecting the jar's manifest
      • and at the end confirm by doing an exact match on the file size
      • Thought: generating and comparing md5 hashes on files might yield the same results quicker?
  3. Even after the jar dependencies have been moved to common/lib folder, one might not want to expose any of the other common jars in the shared folder to their webapp. For this case, the wiki about embedding JBoss into Tomcat gives us an idea about the possibility of only having each web application refer strictly to the jars it really needs via the help of a resource scanner listener.
Possible pitfalls:
  1. There may not be a hook in the tomcat code where we have a consolidated list of the docBase attribute for all the web applications!
  2. Even if such a hook exists, it may be happening at three different places:
    1. when the application contexts defined via server.xml are processed,
    2. when the war files directly under the webapps/ folderare processed,
    3. and when the context-fragment files under conf/Catalina/localhost/ folder are processed!
  3. The user starting tomcat may not have the permissions required to move the files around.
Alternate approach:
  1. Piggyback off a resource scanner listener per application and create a list/report as each individual app comes up.
  2. Then Tomcat can be shutdown and the list/report can be acted upon by a script that runs under an admin/root account to achieve the same results as before.
  3. Starting back the tomcat server afterwards should be fine.
It is now 7:33 PM on 3/19/2011 and it still a Saturday :)
Sent an email to the tomcat users list to find out if a hook into the process exists.
Started the process of getting and building the source-code for Tomcat.

Thursday, March 4, 2010

Hardly a Flex-ible Journey: Moving from Flex 4-Beta 2 to a Stable Build Or Nightly Build

  1. Search and replace all instances of 4.0.0.10485 with the desired version (4.0.0.13875 in my case) which hopefully has already been published to maven or you have uploaded to your local repository.
    1. com.adobe.flex:flex-framework and com.adobe.flex.framework:compiler were updated for me
  2. Change the version of your org.sonatype.flexmojos:flexmojos-maven-plugin to be 3.6-SNAPSHOT
    1. Usually the repository for this is the following one: http://repository.sonatype.org/content/groups/flexgroup/
    2. Make DAMN sure that in your repository definition you have the snapshots enabled set to true
  3. Some of the locale related SWC files are not published on the maven repositories but you can overcome that by downloading the SDK and uploading the missing files manually to your local maven repository.
  4. Don't forget to tell your Flash Builder IDE about the SDK ... Project > Properties > Flex Compiler > Use a specific SDK: Flex 4.0 (build 13875)
  5. Replace all instances of xmlns:mx="library://ns.adobe.com/flex/halo" with xmlns:ns="library://ns.adobe.com/flex/mx" using your favorite tool, mine is pspad.
  6. Replace all instances of mx: with ns:
  7. Follow the instructions from this post to get your code compiling. Note: I said compiling ... not functioning!
  8. Update your injection libraries if you use any. I use Parsley so I went and downloaded parsley-2.2.0 and YES if you use maven then you also need to update the parsley version in pom.xml in order to use it.

Monday, January 4, 2010

Moving Maven from Flex 3 to Flex 4

Often you may have a dependency for Flex 3 in your pom.xml, such as:

com.adobe.flex.framework
flex-framework
3.x.x.xxxx
pom

and you may be wondering how to get up to speed with Flex 4 as you cannot find a version # to attach to the SDK you downloaded! Well you can look here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 as this page lists the build # that you want to stick into the tag.

For example, after looking at the website listed above,
a) with flex 4 beta 2 you would put: 4.0.0.10485
b) with flex 4 beta 1 you would put: 4.0.0.7219

Also you can check you local installation: FLEX_HOME\sdks\X.X.X\flex-sdk-description.xml

If you have flex mojos as part of your pom also then make sure to have a look here too: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version ... You should also know that it didn't seem to work right away, instead afterr half hour of leaving that config in place but not having it work, eclipse magically found and downloaded the right compiler version and all went well. Not sure if it had to do with network timeouts or if the stuff was just added to the maven repo very recently.