Automating hudson/jenkins via REST and curl – a very small cookbook

12/01/2012 Leave a comment

As you know, Hudson supports a RESTful-API. So here a small cookbook using curl (running in cygwin). It is very easy, when you are accustomed to it.

#Get the current configuration and save it locally
curl -X GET http://user:password@hudson.server.org/job/myjobname/config.xml -o mylocalconfig.xml

#Update the configuration via posting a local configuration file
curl -X POST http://user:password@hudson.server.org/job/myjobname/config.xml --data-binary "@mymodifiedlocalconfig.xml"

#Creating a new job via posting a local configuration file
curl -X POST "http://user:password@hudson.server.org/createItem?name=newjobname" --data-binary "@newconfig.xml" -H "Content-Type: text/xml"

Update: Use --data-binary to post the data, else the line-endings won’t be transfered correctly.

Netbeans: “Copy fully qualified name” plugin for 7.1.RC2

29/12/2011 Leave a comment

As an eclipse veteran, i wondered why i could not copy the fully qualified name of the currently selected class to the clipboard. I looked it up, there is already a plugin Copy FQN. But it only runs with Netbeans 6.X.

So i introduced myself to the netbeans plattform api and migrated the plugin to be runable with Netbeans 7.1.RC2.

http://code.google.com/p/copyfqn-fork-for-netbeans71rc2/

Categories: java Tags: , , , ,

Netbeans module development with JRebel

28/12/2011 Leave a comment

In [project]\nbproject\platform.properties add the following line

run.args.extra=-J-noverify -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true

Note:

  • This requires a proper installation of jrebel in the path e:/tools/jrebel/
  • You have to compile the changed java source manually by Menu->Run->Compile file(“Compile-on-save” is not yet available for netbeans modules)
  • There will be some OSGI-exceptions when running/debugging the application, but class reloading works properly.

Tested with NetBeans IDE 7.1 RC2 (Build 201111302200)+7.1, JRebel 4.5.3


Other resources: http://blogs.codehaus.org/people/mkleint/2009/07/maven-netbeans-platform-javare.html

Update: You can also have a look at Javeleon

Update 2: In maven-based nbms you can run modules the following way

  • enable “compile on save”
  • generate rebel.xml to /src/production using the context menu of jrebel (this way it will be copied to target/classes)
  • alter the properties-section of the pom.xml like this
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <netbeans.run.params.ide/>
            <netbeans.run.params>-J-noverify -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params>
        </properties>
    
  • run the module the normal way – you will accounter some osgi-exception as mentioned above
  • make changes to your classes and jrebel will pick it up like [207230] JRebel: Reloading class 'b2s.compare.clipboard.TextDiffer'.
  • small issue: the jrebel-messages do not appear on the output-window – but in jrebel.log
Categories: java, maven Tags: , , , , , ,

[Quicktip] Format a drive larger than 32 GB with FAT32 using Win7

16/07/2011 Leave a comment
Categories: Download, Tools Tags: , , ,

Cool retro-combination: dosbox+abandonia.com+dosbox games launcher

13/07/2011 Leave a comment
Categories: Download Tags: ,

[Quicktip] Changing font and font-size in g-brief

19/06/2011 Leave a comment

You want to change the font and font-size of latex “g-brief” (usage: business letters)?
Here you go

% change size
\documentclass[german,a4paper,10pt]{g-brief}
% change font
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}

Sources:

http://www.wer-weiss-was.de/theme155/article2405641.html

http://www.mrunix.de/forums/showthread.php?t=51401

Categories: latex Tags: , ,

[Quicktip] CVS-Changelog plugin for eclipse

07/05/2011 1 comment

As you know CVS is file-based and therefore it has many issues.

For example: In Eclipse (using the standard CVS-plugin) you can only see changes of the currently selected file in the history view. When you select the project, you see no history entries in the project like you are used to using SVN. I know, you can call "cvs log" to see all changes of all file, but that is not very comfortable.

A solution: Install the changelog plugin (http://code.google.com/a/eclipselabs.org/p/changelog/) and working with CVS is now easier… Internally it will call  "cvs log" and present the processed results in a clear table view manner. (See the screenshot at the project page and you will see what i mean.)

[Update] Monitoring tomcat instances

07/05/2011 Leave a comment

Here are some OSS projects to monitor your tomcat instances (f.e. memory-/cpu-usage, sessions, mbeans)

Off course you can also monitor your tomcat via VisualVM (http://visualvm.java.net/ or included in JDK6)

Update: Or use JRDS http://jrds.fr/

Categories: java Tags: , , , , , ,

[Quicktip] Importing a “dependencyManagement”-section from an external artefact

04/05/2011 Leave a comment

Situation: You have a parent pom with defined dependencies in the “dependency management”-section. This way you do not have to provide versions for your dependencies. Standard-Maven-Stuff.

New situation: BUT for some reason you have to switch to another totally different parent pom with totally different “dependency management”-section. Your previously declared dependencies have no version, so there will be errors when invoking maven on this pom.

One solution: A cool thing you can do since Maven 2.0.9 is the import of the “dependency management”. So still no versions required for your previously declared dependencies…

This is accomplished by declaring a pom artifact as a dependency with a scope of “import”.

The offical documentation can be found here

More shortcuts/quickfixes for eclipse

03/02/2011 Leave a comment

After a short detour to Idea Intellj, i am back to eclipse now and there is still potential to learn new features/shortcuts for improved productivity.

Here a few i was not aware of:

  • Ctrl-3: quick access – all commands, filterable
  • Ctrl-E: to list open files, there you can close the currently selected file by pressing del
  • Alt-Shift-W: Show current file in view xyz
  • F12: go to editor pane
  • Shift-Enter: Create a new line below – no longer Shift-End, Enter
  • Ctrl-Q: go to the last edit location
  • Ctrl-T: Quick type hierarchy
  • Sharing plugins in external folder – how to manage it properly.
  • Pick out part of a string via Quickfix

Mainly influenced by http://eclipseone.wordpress.com/

Any cool missed features or quickfixes out there?

Categories: java Tags: , , , , ,
Follow

Get every new post delivered to your Inbox.