Plugin tutorial

This document, together with the hello-world plugin, shows you how to get started with the plugin development.

What Can Plugins Do?

Hudson defines extensibility points, which are interfaces or abstract classes that model an aspect of a build system. Those interfaces define contracts of what need to be implemented, and Hudson allows plugins to contribute those implementations. See this document for more about extension points.

In this document, we'll be implementing a Builder that says hello. (built-in builders include Ant, Maven, and shell script. Builders build a project.)

Other resources

Besides this tutorial, there are other tutorials and examples available on line:

Setting Up Environment

To develop a plugin, you need Maven 2 (why?) and JDK 6.0 or later. If this is the first time you use Maven, make sure Maven can download stuff over the internet.

With a fairly recent version of Maven (ie. 2.0.9 or newer) you should only need to add the following to your ~/.m2/settings.xml (Windows users will find them in %USERPROFILE%\.m2\settings.xml):

<settings>

<pluginGroups>
  <pluginGroup>org.jvnet.hudson.tools</pluginGroup>
</pluginGroups>

</settings>

This will let you use short names of Hudson Maven plugins (ie. hpi:create instead of org.jvnet.hudson.tools:maven-hpi-plugin:1.23:create).

If you are using Maven version earlier than 2.0.9, you'll need to follow additional steps.

Creating a New Plugin

To start a new plugin, run the following maven command:

$ mvn -cpu hpi:create

This will ask you a few question, like the groupId (the maven jargon for the package name) and the artifactId (the maven jargon for your project name), then create a skeleton plugin from which you can start with. Make sure you can build this:

$ cd newly-created-directory
$ mvn package

Explanations:

-cpu means that Maven should update all relevant Maven plugins.
hpi: as prefix specifies that the following goal will invoke the part of the Hudson HPI Plugin, a plugin for supporting plugin development
create is the goal which creates the directory layout and the pom for the new Hudson plugin and it adds it to the module list
package is a standard goal which compiles all sources, runs the tests and creates a package - overwritten by the HPI plugin it will create a *.hpi file

Setting up a productive environment with your IDE

NetBeans

NetBeans users can use the IDE's Maven support to open the project directly. (Bundled in 6.7 and up; available from Plugin Manager for 6.5.) The archetype may also be available right from the New Project dialog.

IntelliJ IDEA

IntelliJ 7.0 (or later) users can load pom.xml directly from IDE, and you should see all the source code of libraries and Hudson core all the way to the bottom.

IntelliJ Maven defaults to downloading sources and JavaDocs on demand. So, to see the source, you may need to click the Download artifacts button in the Maven Projects tab.

Eclipse

Use Eclipse 3.3 or later to avoid a bug in Eclipse 3.2 (more details.)
Eclipse users can run the following Maven command to generate Eclipse project files:

$ mvn -DdownloadSources=true -DdownloadJavadocs=true eclipse:eclipse

Alternatively, Eclipse users can install the maven2 eclipse plug-in, to open a Maven project directly in IDE.

If you get the error message Unable to find a plugin class. Did you put @plugin in javadoc? this maybe caused by eclipse and maven both use the target folder for build output.
Run mvn clean before building with maven or change the output path.

Plugin Workspace Layout

The plugin workspace consists of the following major pieces:

pom.xml

Maven uses it for building your plugin

src/main/java

Java source files of the plugin

src/main/resources

Jelly/Groovy views of the plugin. See this document for more about it.

src/main/webapp

Static resources of the plugin, such as images and HTML files.

Source Code

Let's take a look at the source code. A plugin's main entry point is a PluginImpl class that extends from Plugin. Once Hudson detects your plugin class (via its inheritance relationship from Plugin), it will create an instance, and invokes methods.

Most of the time, a plugin class just registers extension points, and your main work involves in implementing those extension points. See the source code for more about how a Builder is implemented and what it does.

Debugging a Plugin

NetBeans 6.7+ users can just hit Debug. For all others, run the following command to launch Hudson with your plugin:
Convenient:

mvnDebug hpi:run

Unix:

$ export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n"
$mvn hpi:run

Windows:

> set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
> mvn hpi:run

If you open http://localhost:8080/ in your browser, you should see the Hudson page running in Jetty. The MAVEN_OPTS portion launches this whole thing with the debugger port 8000, so you should be able to start a debug session to this port from your IDE.

Once this starts running, keep it running. Jetty will pick up all the changes automatically.

  1. When you make changes to view files in src/main/resources or resource files in src/main/webapp, just hit F5 in your browser to see the changes.
  2. When you change Java source files. Compile them in your IDE (NetBeans 6.7+: Debug > Apply Code Changes) and Jetty should automatically redeploy Hudson to pick up those changes. There is no need to run mvn at all.
    MAVEN_OPTS can be used to specify all sorts of other JVM parameters, like -Xmx

Changing port

If you need to launch the Hudson on a different port than 8080, set the port through the system property port

$ mvn hpi:run -Djetty.port=8090

Distributing a Plugin

To create a distribution image of your plugin, run the following Maven goal:

$ mvn package

This should create target/*.hpi file. Other users can use Hudson's web UI to upload this plugin to Hudson (or place it in $HUDSON_HOME/plugins.)

Hosting a Plugin on java.net

If you got to this point, you should definitely consider hosting your plugin on java.net. Move on to this document for how to do that.

Other tips

  1. Consider running Maven like mvn -o ... to avoid hitting repositories every time. This will make various operations considerably faster.
  2. Subscribe to users@hudson.dev.java.net from here so that we can get in touch with you.
  3. When you bump up the version of Hudson you depend on, make sure to run mvn clean once, in particular to delete target/work that Jetty uses. Newer versions may just use work, not target/work. Otherwise your Jetty may continue to pick up old left-over jar files.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Jul 18, 2007

    Anonymous says:

    I think that the pom mentioned in this page is out of date. You will need to edi...

    I think that the pom mentioned in this page is out of date. You will need to edit it to have the following:

     java.net
    url = http://download.java.net/maven/1

     java.net2
    url = http://download.java.net/maven/2

    1. Jul 23, 2007

      Kohsuke Kawaguchi says:

      Thanks. Fixed.

      Thanks. Fixed.

  2. Jul 24, 2007

    Stephen Connolly says:

    We need to update the hpi plugin so that the httpPort bound during hpi:run is us...

    We need to update the hpi plugin so that the httpPort bound during hpi:run is user configurable form the command line.

    E.g. something like

     mvn hpi:run -DhttpPort=xxxx

    As in some cases I already have a tomcat instance on 8080 that I'm not exactly keep to restart (as I'm doing hudson development while waiting for the tomcat instance to do some other stuff

    1. Aug 04, 2007

      Kohsuke Kawaguchi says:

      Added https://hudson.dev.java.net/nonav/maven-hpi-plugin/
  3. Aug 20, 2007

    Anonymous says:

    Hi - I followed the instructions and I got the following error when I tried 'mv...

    Hi -

    I followed the instructions and I got the following error when I tried 'mvn package' in the project the hpi archetype created:

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Internal error in the plugin manager executing goal 'org.jvnet.hudson.tools:maven-hpi-plugin:1.11:apt-compi
    le': Unable to find the mojo 'org.jvnet.hudson.tools:maven-hpi-plugin:1.11:apt-compile' in the plugin 'org.jvnet.h
    udson.tools:maven-hpi-plugin'
    com/sun/mirror/apt/AnnotationProcessorFactory
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5 seconds
    [INFO] Finished at: Mon Aug 20 22:25:53 PDT 2007
    [INFO] Final Memory: 27M/64M
    [INFO] ------------------------------------------------------------------------

    1. Aug 21, 2007

      Kohsuke Kawaguchi says:

      Could you please file this as an issue in the issue tracker, and run the same wi...

      Could you please file this as an issue in the issue tracker, and run the same with "mvn -X" and attach the log file?
      (You'd need to request the observer role in the project to do this — thanks!)

  4. Aug 29, 2007

    Anonymous says:

    Hi, I followed your instructions (downloading Maven2, then getting the pom.xml ...

    Hi,

    I followed your instructions (downloading Maven2, then getting the pom.xml and doing mvn package) but I can't modify the settings.xml... I don't have that file in my .m2 directory

    Could you help?

    Thanx

    1. Sep 03, 2007

      Frank LaFond says:

      I was able to get past this point with the simple settings.xml file: <settin...

      I was able to get past this point with the simple settings.xml file:

      <settings>
         <pluginGroups>
            <pluginGroup>org.jvnet.hudson.tools</pluginGroup>
         </pluginGroups>
      </settings>
      

       It worked for me.

      Frank LaFond. 

  5. Nov 24, 2007

    km says:

    I get the following error with the maven-hpi-plugin version 1.11: E:\coder\hgsl...

    I get the following error with the maven-hpi-plugin version 1.11:

    E:\coder\hgsls\java\skype>mvn org.jvnet.hudson.tools:maven-hpi-plugin:1.11:create
    [INFO] Scanning for projects...
    Downloading: http://repo1.maven.org/maven2/org/jvnet/hudson/tools/maven-hpi-plugin/1.11/maven-hpi-plugin-1.11.pom
    Downloading: http://repo1.maven.org/maven2/org/jvnet/hudson/tools/maven-hpi-plugin/1.11/maven-hpi-plugin-1.11.pom
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to resolve artifact.
    
    GroupId: org.jvnet.hudson.tools
    ArtifactId: maven-hpi-plugin
    Version: 1.11
    
    Reason: Unable to download the artifact from any repository
    
      org.jvnet.hudson.tools:maven-hpi-plugin:pom:1.11
    
    from the specified remote repositories:
      central (http://repo1.maven.org/maven2)
    

    But when i use maven-hpi-plugin version 1.14 it works. BTW it took 31 minutes 46 seconds.

  6. Dec 12, 2007

    Anonymous says:

    Yo Kawaguchi... just have to say that Hudson's architecture (and your Stapler pr...

    Yo Kawaguchi... just have to say that Hudson's architecture (and your Stapler project) are just insanely elegant. High fives all around.

    1. Dec 12, 2007

      Mike Caron says:

      Uh, yeah... I wasn't logged in. This is me.

      Uh, yeah... I wasn't logged in. This is me.

  7. Feb 23, 2008

    Matthew R Harrah says:

    I got Maven 2.0.8 and installed it according to their directions, downloaded the...

    I got Maven 2.0.8 and installed it according to their directions, downloaded the pom.xml file into a new directory, and ran mvn package and got this error:

    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] The plugin 'org.jvnet.hudson.tools:maven-hpi-plugin' does not exist or no valid version could be found
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Sat Feb 23 11:00:40 EST 2008
    [INFO] Final Memory: 1M/254M
    [INFO] ------------------------------------------------------------------------
    

    I also tried using a settings.xml file as described (the "crude" way) and got the same error.  I am not behind any proxy.

    Any ideas?  Since I am new to Maven I am pretty sure its some dumb thing I'm doing.... 

    1. Feb 24, 2008

      Lyndon Washington says:

      I got the same problem that Matthew did with version 2.08 of maven.  I trie...

      I got the same problem that Matthew did with version 2.08 of maven.  I tried going back to 2.04 and that did not seem to help.

      Cheers!

      1. Feb 24, 2008

        Lyndon Washington says:

        Oh never mind.  I looked in the ~/.m2/repository and found the version...

        Oh never mind.  I looked in the ~/.m2/repository and found the version is 1.17 at this point.  Sorry!!

    2. Feb 24, 2008

      Matthew R Harrah says:

      Turns out I was right.  It was something dumb I was doing.  My firewal...

      Turns out I was right.  It was something dumb I was doing.  My firewall software was not allowing java.exe to access the internet.

  8. Feb 29, 2008

    Anonymous says:

    I want to download the source for a plugin and make a patch.  But I can't e...

    I want to download the source for a plugin and make a patch.  But I can't even get the source!

    I'm behind a proxy that uses a username/password. I got Maven to download everything, but no source!

    And then I tried checking it out of CVS and got this:

    $ cvs "-d:pserver;proxy=proxyhost.com;proxyport=3128:guest@cvs.dev.java.net:/cvs" co hudson/hudson/plugin/co
    zsh: correct 'cvs' to '_cvs' [nyae]? n
    cvs checkout: WARNING: Ignoring method options found in CVSROOT: `proxy=proxyhost.com;proxyport=3128'.
    cvs checkout: Use CVS version 1.12.7 or later to handle method options.
    cvs checkout: warning: skipping invalid entry in password file at line 1
    cvs server: cannot find module `hudson/hudson/plugin/cobertura' - ignored
    cvs [checkout aborted]: cannot expand modules
    

    Any help?

    1. Feb 29, 2008

      Kohsuke Kawaguchi says:

      The error message says it all. There's no such module `hudson/hudson/plugin/cobe...

      The error message says it all. There's no such module `hudson/hudson/plugin/cobertura'
      You made a typo. It's "plugins".

  9. Mar 04, 2008

    Dan Lewis says:

     I followed the instructions and I get the following error when I do mvn hp...

     I followed the instructions and I get the following error when I do mvn hpi:run:[INFO] Started Jetty Server
    [INFO] Starting scanner at interval of 1 seconds.
    2008-03-04 13:15:12.765:/:INFO:  Stapler: init
    2008-03-04 13:15:12.781::WARN:  EXCEPTION
    javax.servlet.ServletException: there's no "app" attribute in the application context.
            at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:446)
            at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:370)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:468)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
            at hudson.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:79)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
            at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
            at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
            at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
            at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
            at org.mortbay.jetty.Server.handle(Server.java:285)
            at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
            at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
    I am using Maven 2.0.8, Java 1.6.0_02 on Windows XP Pro SP2.  Am I doing something wrong?  I am new to Maven.

  10. Mar 13, 2008

    Erling Linde says:

    I have problems with external dependencies: I get lots of these: Caused by: jav...

    I have problems with external dependencies:

    I get lots of these: Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.syndication.propono.atom.client.AtomClientFactory

    I have referenced the libraries using Maven 2, e.g.:

        <dependency>
          <groupId>propono</groupId>
          <artifactId>propono</artifactId>
          <version>0.6</version>
        </dependency> 

    The libraries are included in WEB-INF/lib

    I have also tried putting the libraries in tomcat/lib and also tomcat/webapps/hudson/WEB-INF/lib 

    Where should external jars be put? How should they be referenced?

    Thanks, Erling 


  11. Mar 23, 2008

    turbouser says:

    Any help is appreciated...How do I resolve the error? C:\Program Files\Apache S...

    Any help is appreciated...How do I resolve the error?

    C:\Program Files\Apache Software Foundation\apache-maven-2.0.8\tmp>mvn package
    [INFO] Scanning for projects...
    Downloading: http://download.java.net/maven/1//org.jvnet.hudson.tools/poms/tools&#45;1.4.pom
    Downloading: http://download.java.net/maven/2//org/jvnet/hudson/tools/tools/1.4/tools-1.4.pom
    Downloading: http://download.java.net/maven/2/org/jvnet/hudson/tools/tools/1.4/tools-1.4.pom
    Downloading: http://repo1.maven.org/maven2/org/jvnet/hudson/tools/tools/1.4/tools-1.4.pom
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error building POM (may not be this project's POM).

    Project ID: null:maven-hpi-plugin:maven-plugin:1.18

    Reason: Cannot find parent: org.jvnet.hudson.tools:tools for project: null:maven
    -hpi-plugin:maven-plugin:1.18 for project null:maven-hpi-plugin:maven-plugin:1.1
    8

    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Sun Mar 23 23:00:15 PDT 2008
    [INFO] Final Memory: 1M/4M
    [INFO] ------------------------------------------------------------------------

    1. Mar 24, 2008

      David Hayes says:

      This is basically to do with the fact that the java.net maven source and the hud...

      This is basically to do with the fact that the java.net maven source and the hudson source are slightly out of sync. Not to worry, a simple fix locally will fix this:

       Change the file:

      c:\documents and settings\your user\.m2\repository\org\jvnet\hudson\tools\maven-hpi-plugin\1.18\maven-hpi-plugin-1.18.pom
      (change this to whatever suits your operating system)

      Right near the top of the file, you'll see the following block:

        <parent>
          <groupId>org.jvnet.hudson.tools</groupId>
          <artifactId>tools</artifactId>
          <version>1.4</version>
          <relativePath>../pom.xml</relativePath>
        </parent>
      

       Change this to:

        <parent>
          <groupId>org.jvnet.hudson.tools</groupId>
          <artifactId>tools</artifactId>
          <version>1.1</version>
          <relativePath>../pom.xml</relativePath>
        </parent>
      


      Note the change of the version number. Now try again, and everything should work!

      1. Mar 25, 2008

        turbouser says:

        You were 100% right.  Everything is working now.  -Thanks.

        You were 100% right.  Everything is working now.  -Thanks.

      2. Mar 28, 2008

        Max Sauer says:

        Thanks for this, the tools-1.4.pom is not present inside repository. It would be...

        Thanks for this, the tools-1.4.pom is not present inside repository. It would be fine to have a note in the tutorial above.

      3. Mar 31, 2008

        Kohsuke Kawaguchi says:

        This is fixed now. In the future, please report these issues to the issue tracke...

        This is fixed now. In the future, please report these issues to the issue tracker, so that we can fix it, instead of asking everyone to work around the problem.

  12. Apr 08, 2008

    Wojtek Gworek says:

    Can anybody send me pom.xml from https://hudson.dev.java.net/source/browse/*chec...

    Can anybody send me pom.xml from https://hudson.dev.java.net/source/browse/*checkout*/hudson/hudson/tools/bootstrap/pom.xml
    Any time I try to access it I do see response about Unknown location: hudson/tools/bootstrap/pom.xml

    1. Apr 08, 2008

      Kohsuke Kawaguchi says:

      Link fixed. This was due to CVS->SVN migration.

      Link fixed. This was due to CVS->SVN migration.

  13. May 14, 2008

    Munish Gopal says:

    When i run mvn package command, I get this error: [INFO] [hpi:apt-compile] [INF...

    When i run mvn package command, I get this error:

    [INFO] [hpi:apt-compile]
    [INFO] Compiling 2 source files to /opt/setups/apache-maven-2.0.9/agitar/target/classes
    [FATAL ERROR] org.jvnet.hudson.maven.plugins.hpi.AptMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms:
    [FATAL ERROR] Plugin realm = app0.child-container[org.jvnet.hudson.tools:maven-hpi-plugin]
    urls[0] = file:/root/.m2/repository/org/jvnet/hudson/tools/maven-hpi-plugin/1.20/maven-hpi-plugin-1.20.jar
    urls[1] = file:/root/.m2/repository/org/apache/maven/maven-archiver/2.0.1/maven-archiver-2.0.1.jar
    urls[2] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
    urls[3] = file:/root/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-4/plexus-archiver-1.0-alpha-4.jar
    urls[4] = file:/root/.m2/repository/org/mortbay/jetty/maven-jetty-plugin/6.1.1/maven-jetty-plugin-6.1.1.jar
    urls[5] = file:/root/.m2/repository/commons-el/commons-el/1.0/commons-el-1.0.jar
    urls[6] = file:/root/.m2/repository/org/mortbay/jetty/jetty/6.1.1/jetty-6.1.1.jar
    urls[7] = file:/root/.m2/repository/org/mortbay/jetty/jetty-util/6.1.1/jetty-util-6.1.1.jar
    urls[8] = file:/root/.m2/repository/org/mortbay/jetty/servlet-api-2.5/6.1.1/servlet-api-2.5-6.1.1.jar
    urls[9] = file:/root/.m2/repository/org/apache/maven/maven-plugin-tools-api/2.0/maven-plugin-tools-api-2.0.jar
    urls[10] = file:/root/.m2/repository/org/mortbay/jetty/jetty-plus/6.1.1/jetty-plus-6.1.1.jar

    ..............

    .........

    [FATAL ERROR] Container realm = plexus.core
    urls[0] = file:/opt/setups/apache-maven-2.0.9/lib/maven-2.0.9-uber.jar
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] com.sun.tools.apt.Main
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    java.lang.NoClassDefFoundError: com.sun.tools.apt.Main
            at org.jvnet.hudson.maven.plugins.hpi.AptCompiler.compileInProcess(AptCompiler.java:62)
            at org.jvnet.hudson.maven.plugins.hpi.AptCompiler.compile(AptCompiler.java:50)
            at org.jvnet.hudson.maven.plugins.hpi.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:486)
            at org.jvnet.hudson.maven.plugins.hpi.CompilerMojo.execute(CompilerMojo.java:111)
            at org.jvnet.hudson.maven.plugins.hpi.AptMojo.execute(AptMojo.java:21)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:615)
            at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

    I am struck at this point. Can anyone help?

  14. May 14, 2008

    Jeff Berkowitz says:

    Munish, I take it from the appearance of codehaus in your stack backtrace that y...

    Munish, I take it from the appearance of codehaus in your stack backtrace that you may be using the "mevenide" plugin for netbeans.  If so, please look at the email archives for the last few days at http://www.nabble.com/codehaus---mevenide-f11958.html because there appears to be a problem with the latest version of the plugin.

  15. Jul 13, 2008

    Michael Greifeneder says:

    If you get an error like this: >mvn org.jvnet.hudson.tools:maven-hpi-plugin:...

    If you get an error like this:

    >mvn org.jvnet.hudson.tools:maven-hpi-plugin:1.20:create

    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to resolve artifact.

    Missing:
    ----------
    1) com.sun:tools:jar:1.5

    You probably haven't set JAVA_HOME correctly.

  16. Oct 08, 2008

    Kenneth Bowen says:

    $ mvn org.jvnet.hudson.tools:maven-hpi-plugin:1.20:create [INFO] Scanning for p...
    $ mvn org.jvnet.hudson.tools:maven-hpi-plugin:1.20:create
    [INFO] Scanning for projects...
    Downloading: http://repo1.maven.org/maven2/org/jvnet/hudson/tools/maven-hpi-plug
    in/1.20/maven-hpi-plugin-1.20.jar
    [INFO] Cannot find mojo descriptor for: 'org.jvnet.hudson.tools:maven-hpi-plugin
    :1.20:create' - Treating as non-aggregator.
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven Default Project
    [INFO]    task-segment: [org.jvnet.hudson.tools:maven-hpi-plugin:1.20:create]
    [INFO] ------------------------------------------------------------------------
    Downloading: http://repo1.maven.org/maven2/org/jvnet/hudson/tools/maven-hpi-plug
    in/1.20/maven-hpi-plugin-1.20.jar
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] A required plugin was not found: Plugin could not be found - check that t
    he goal name is correct: Unable to download the artifact from any repository
    


    I like Hudson, and would like to contribute a plugin. However, in spite of the fact that I've built and deployed more than 100 enterprise Java projects since 1999, Maven absolutely makes me sick. I cringe at all the wonderful projects that are adopting it.

    I followed all the directions above, and tried anything in the comments that looked like it would help. Please reconsider your choice of this miserable tool.

    1. Oct 09, 2008

      Ulli Hafner says:

      Did you update your settings file as described in section "Setting Up Environmen...

      Did you update your settings file as described in section "Setting Up Environment"?

      1. Oct 09, 2008

        Kenneth Bowen says:

        Yes I did. I was able to get it to create the sample project by downloading the ...

        Yes I did. I was able to get it to create the sample project by downloading the failed plugin manually. Did I mention that Maven sucks?

        However, with the help of the sample project and the documentation, I see how easy it is to create my plugin using Ant.

        1. Oct 14, 2008

          Mark Stellaard says:

          Hi Kenneth, The version should be 1.21 instead of 1.20. Then it should work fin...

          Hi Kenneth,

          The version should be 1.21 instead of 1.20. Then it should work fine.

  17. Nov 18, 2008

    Victor Hugo Germano says:

    Hello!While creating a project, i'm receiving the following error:  $>...

    Hello!While creating a project, i'm receiving the following error:

     $> mvn org.jvnet.hudson.tools:maven-hpi-plugin:1.23:create -e
    
    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven Default Project
    [INFO]    task-segment: [org.jvnet.hudson.tools:maven-hpi-plugin:1.23:create] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Lorg/apache/maven/archetype/Archetype;
    org.apache.maven.archetype.Archetype
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    java.lang.NoClassDefFoundError: Lorg/apache/maven/archetype/Archetype;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
        at java.lang.Class.getDeclaredField(Class.java:1880)
        at hidden.org.codehaus.plexus.util.ReflectionUtils.getFieldByNameIncludingSuperclasses(ReflectionUtils.java:31)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.getFieldByName(FieldComponentComposer.java:212)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.findMatchingField(FieldComponentComposer.java:171)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:62)
        at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
        at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
        at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:312)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:609)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:429)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: java.lang.ClassNotFoundException: org.apache.maven.archetype.Archetype
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
        at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 36 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 9 seconds
    [INFO] Finished at: Tue Nov 18 20:41:43 BRST 2008
    [INFO] Final Memory: 8M/18M
    [INFO] ------------------------------------------------------------------------
     
    

    System: Ubuntu 8.10

    I didn't install maven as an ubuntu's package, but as a zip file... the following program works well (creating a simples web application):

    $> mvn archetype:create
    


    Any suggestions?

    Thanks a lot!

  18. Nov 19, 2008

    Teemu Kolehmainen says:

    Could you add the instructions on how to do it the "right" way (with pluginRepos...

    Could you add the instructions on how to do it the "right" way (with pluginRepository) now that the Maven bug has been resolved?

    1. Dec 20, 2008

      Paweł Paprota says:

      Done.

      Done.

  19. Apr 13, 2009

    Brian Lalor says:

    hpi:create isn't working for me. I'm using maven-hpi-plugin 1.34 with Maven 2.0....

    hpi:create isn't working for me. I'm using maven-hpi-plugin 1.34 with Maven 2.0.9.

    [blalor@vm-fc8 ...d_roots/hudson_deploy_plugin/checkout]> emacs_mvn_helper.sh -Phudson-plugin-dev  org.jvnet.hudson.tools:maven-hpi-plugin:1.34:create -e
    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven Default Project
    [INFO]    task-segment: [org.jvnet.hudson.tools:maven-hpi-plugin:1.34:create] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
    [INFO] Setting property: velocimacro.messages.on => 'false'.
    [INFO] Setting property: resource.loader => 'classpath'.
    [INFO] Setting property: resource.manager.logwhenfound => 'false'.
    [INFO] **************************************************************
    [INFO] Starting Jakarta Velocity v1.4
    [INFO] RuntimeInstance initializing.
    [INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
    [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
    [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
    [INFO] ClasspathResourceLoader : initialization starting.
    [INFO] ClasspathResourceLoader : initialization complete.
    [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
    [INFO] Default ResourceManager initialization complete.
    [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
    [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
    [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
    [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
    [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
    [INFO] Created: 20 parsers.
    [INFO] Velocimacro : initialization starting.
    [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
    [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
    [INFO] Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
    [INFO] Velocimacro :  VM library template macro registration complete.
    [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
    [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
    [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
    [INFO] Velocimacro : initialization complete.
    [INFO] Velocity successfully started.
    [INFO] [hpi:create]
    Enter the groupId of your plugin: foo
    [INFO] Defaulting package to group ID: foo
    Enter the artifactId of your plugin: bar
    [INFO] ----------------------------------------------------------------------------
    [INFO] Using following parameters for creating Archetype: maven-hpi-plugin:1.34
    [INFO] ----------------------------------------------------------------------------
    [INFO] Parameter: groupId, Value: foo
    [INFO] Parameter: packageName, Value: foo
    [INFO] Parameter: basedir, Value: /
    [INFO] Parameter: package, Value: foo
    [INFO] Parameter: version, Value: 1.0-SNAPSHOT
    [INFO] Parameter: artifactId, Value: bar
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to create a new Hudson plugin
    
    Embedded error: Error merging velocity templates
    /bar/pom.xml (No such file or directory)
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to create a new Hudson plugin
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create a new Hudson plugin
            at org.jvnet.hudson.maven.plugins.hpi.CreateMojo.execute(CreateMojo.java:195)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
            ... 16 more
    Caused by: org.apache.maven.archetype.ArchetypeTemplateProcessingException: Error merging velocity templates
            at org.apache.maven.archetype.DefaultArchetype.processTemplate(DefaultArchetype.java:876)
            at org.apache.maven.archetype.DefaultArchetype.processTemplate(DefaultArchetype.java:730)
            at org.apache.maven.archetype.DefaultArchetype.processTemplates(DefaultArchetype.java:475)
            at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:329)
            at org.jvnet.hudson.maven.plugins.hpi.CreateMojo.execute(CreateMojo.java:174)
            ... 18 more
    Caused by: java.io.FileNotFoundException: /bar/pom.xml (No such file or directory)
            at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
            at org.apache.maven.archetype.DefaultArchetype.processTemplate(DefaultArchetype.java:866)
            ... 22 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 20 seconds
    [INFO] Finished at: Mon Apr 13 12:36:16 GMT-05:00 2009
    [INFO] Final Memory: 10M/19M
    [INFO] ------------------------------------------------------------------------
    
    
  20. Apr 27, 2009

    Fredrik Sandberg says:

    When following the instructions above, and running mvn hpi:create I receive a me...

    When following the instructions above, and running mvn hpi:create I receive a message saying that it is missing: com.sun:tools:jar:1.5. When running in debug mode I can see that it is looking for the file C:\Program Files\Java\jdk1.6.0_13\..\lib\tools.jar. Where did the ..\ came from? My JAVA_HOME path is set to C:\Program Files\Java\jdk1.6.0_13. 

    Kindly regards,

    Fredrik

    1. Apr 27, 2009

      Fredrik Sandberg says:

      It actually worked fine if I just changed the JAVA_HOME to the jre subfolder.

      It actually worked fine if I just changed the JAVA_HOME to the jre subfolder.

  21. May 27, 2009

    stuart barlow says:

    I am running instructions on wndows with java 1.5 on windows with mvn (Apache Ma...

    I am running instructions on wndows with java 1.5 on windows with mvn (Apache Maven 2.1.0 (r755702; 2009-03-18 19:10:27+0000)) and I get the following error...

    C:\stuartb\java\HUDSON~1>mvn -e hpi:create
    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] Searching repository for plugin with prefix: 'hpi'.
    [INFO] org.jvnet.hudson.tools: checking for updates from m.g.o-public
    [WARNING] repository metadata for: 'org.jvnet.hudson.tools' could not be retrieved from repository: m.g.o-public due to
    an error: Error transferring file: maven.glassfish.org
    [INFO] Repository 'm.g.o-public' will be blacklisted
    [INFO] org.jvnet.hudson.tools: checking for updates from central
    [WARNING] repository metadata for: 'org.jvnet.hudson.tools' could not be retrieved from repository: central due to an er
    ror: Error transferring file: repo1.maven.org
    [INFO] Repository 'central' will be blacklisted
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] The plugin 'org.apache.maven.plugins:maven-hpi-plugin' does not exist or no valid version could be found
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-hpi-plugin' does not
    exist or no valid version could be found
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1546)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1786)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecuto
    r.java:446)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:176)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-hp
    i-plugin' does not exist or no valid version could be found
            at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.
    java:229)
            at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.
    java:91)
            at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:172)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1517)
            ... 14 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Tue May 26 12:08:54 BST 2009
    [INFO] Final Memory: 1M/3M
    [INFO] ------------------------------------------------------------------------
    C:\stuartb\java\HUDSON~1>
    

    Any thoughts on this?
    Looks like mvn is not all together happy. Possible network issue?
    The path to mvn is strewn with small hurdles. A clever but not simple build process.

    1. May 28, 2009

      stuart barlow says:

      Solved it! Hudson did not say anytyhing but this was a network proxy issue. Once...

      Solved it! Hudson did not say anytyhing but this was a network proxy issue. Once I had the proxy definded in the settings.xml file everything worked fine.
      Thanks mvn for hiding the real error.

  22. Jun 02, 2009

    Gabriel Falkenberg says:

    If you get an error like this: [INFO] [hpi:apt-compile] [INFO] ------------...

    If you get an error like this:

    [INFO] [hpi:apt-compile]
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] JDK6 or later is necessary to build a Hudson plugin
    [INFO] ------------------------------------------------------------------------
    

    when compiling on OS X even though java -version says you are using Java > 1.6 you might need to set JAVA_HOME manually to /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home or something like that, to be sure that maven uses JDK6.

  23. Jun 08, 2009

    Ola Johnsson says:

    I have a problem with running/debugging my plugin. I have set up everything acco...

    I have a problem with running/debugging my plugin. I have set up everything according to the guide and it compiles nicely. I can even create a .hpi-package and install in Hudson with the tutorial. But I can't seem to debug.

    I try to run "mvn hpi:run" which shows some output and from what I can see everything goes well, but I can't connect to localhost?

    Anyone that know what I have done wrong?

  24. Jul 15, 2009

    Heiko Janssen says:

    Hi,  I am totally new to hudson and want to write a plugin. So I followed ...

    Hi,

     I am totally new to hudson and want to write a plugin. So I followed the instructions on this site and did the following:

    01. Downloaded Maven 2.2.0

    02. Modified the Maven settings.xml file due to the xml snippet described on this page

    03. Want to setup a new plugin with mvn hpi:create

    The third step failed with the error message:

    [INFO] Internal error in the plugin manager executing goal 'org.jvnet.hudson.tools:maven-hpi-plugin:1.40:create': Unable to load the mojo 'org.jvnet.hudson.
    tools:maven-hpi-plugin:1.40:create' in the plugin 'org.jvnet.hudson.tools:maven-hpi-plugin'. A required class is missing: Lorg/apache/maven/archetype/Archetype; org.apache.maven.archetype.Archetype

    To resolve this problem I checked whether the class 'Archetype' is in the Maven repository on my disk. I found a directory in %USERPROFILE%\.m2\repository\org\apache\maven\archetype so I thought that I have to add this path to any Maven configuration file or something like this.

    Could anybody give me some suggestions or some keywords where I could read on to get started on writing the plugin?

    Kind regards,

    Heiko

    1. Jul 16, 2009

      Cameron Falkenhagen says:

      Hi, I am having the exact same issue with the exact same error. When I check th...

      Hi,

      I am having the exact same issue with the exact same error.
      When I check the ~/.m2 directory there is no archetype directory in ~/.m2/repository/org/apache/maven

      I'm new to Maven and Hudson plugin development, so it could easily be a rookie mistake.

      Thoughts?

  25. Jul 20, 2009

    Olivier Armand says:

    This thread of the mailing list may help you: http://www.nabble.com/Plugin-creat...
  26. Jul 28, 2009

    Adrian Smith says:

    Everything builds as described, but I can't get the plugin to show up anywhere i...

    Everything builds as described, but I can't get the plugin to show up anywhere in the running Hudson apart from on the installed plugins pages.

     What am I missing please?

    1. Nov 02

      Christophe Furmaniak says:

      If you are an eclipse user and that you used mvn eclipse:eclipse, check the JDK ...

      If you are an eclipse user and that you used mvn eclipse:eclipse, check the JDK compliance of your project. It is set by default to 1.5 but you have to force it to 1.6 and it will work.

  27. Jan 08

    Russ Hickingbottom says:

    I am in the same boat as Adrian - I have it built, I have it installed but I don...

    I am in the same boat as Adrian - I have it built, I have it installed but I don't see anywhere where this manifests itself in my hudson instance?  Any ideas?  I checked my eclipse project and it is JDK 1.6 compliant.

    Any help would be appreciated.

  28. Jan 19

    Vedran Lerenc says:

    Hi, is there an update on the issue with missing class AnnotationProcessorFacto...

    Hi,

    is there an update on the issue with missing class AnnotationProcessorFactory?
    I used the hpi archetype from within Eclipse and set the version of the parent pom to the version I use of Hudson (also tried 1.323 and 1.310):

    <parent>
    <groupId>org.jvnet.hudson.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>1.329</version>
    </parent>

    What I get is similar to a former post here (it had no resolution):

    Internal error in the plugin manager executing goal 'org.jvnet.hudson.tools:maven-hpi-plugin:1.45:apt-compile': Unable to load the mojo 'org.jvnet.hudson.tools:maven-hpi-plugin:1.45:apt-compile' in the plugin 'org.jvnet.hudson.tools:maven-hpi-plugin'. A required class is missing: com/sun/mirror/apt/AnnotationProcessorFactory

    Does anyone have a hint for me?

    Thanks, Vedran

    1. Jan 19

      Vedran Lerenc says:

      After some deeper analysis, the problem was related to my JVM. It's slightly dif...

      After some deeper analysis, the problem was related to my JVM. It's slightly different and missed that class. Need to find out why, but since the hpi plugins expect the above mentioned class to be present they couldn't work in my case. Maybe declaring an explicit dependency could improve the situation? I found the class also in other artifacts on Maven Central and Glassfish (which first confused me), so others have repackaged the stuff (it's not strictly part of the main runtime libraries, but the apt tools library). Ok, that was just fyi. Cheers, Vedran

      1. Jan 19

        Sylvain V. says:

        Hello Vedran, I just started a plugin project with the tutorial, and had exactl...

        Hello Vedran,

        I just started a plugin project with the tutorial, and had exactly the same problem, so it is (probably) not specific of your installation.

        1. Jan 19

          Vedran Lerenc says:

          Hi Sylvain, at least in my case switching back to Sun Hotspot JVM of jdk1.6.0_16...

          Hi Sylvain, at least in my case switching back to Sun Hotspot JVM of jdk1.6.0_16 fixed the problem immediately and it works now for me. Regards, Vedran

          1. Jan 19

            Sylvain V. says:

            OK, after investigation, the issue for me is from Eclipse IAM (Maven integration...

            OK, after investigation, the issue for me is from Eclipse IAM (Maven integration) that does not include JDK jars (only JRE), so tools.jar is not included, even if everything is pointing on the JDK. Its a classical Eclipse/JRE/JDK classpath hell. It is not a hudson maven packaging issue (command-line maven works fine in all cases).