mvn hpi:run fails with NullPointerException

259 views
Skip to first unread message

Jean-Karlo Accetta

unread,
Oct 31, 2017, 2:18:06 PM10/31/17
to Jenkins Developers
Hi all,

I am new to developing plugins for Jenkins, and I was reading several of the related pages on getting started.  The problem is that whenever I try to run any build step or goal, it fails.  I tried first with the hpi:run command they say to use for debugging, but any goal will result in the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (display-info) on project jenkins-plugins: Execution display-info of goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce failed.: NullPointerException -> [Help 1]


I'm not sure what is going on, but all my other maven projects work fine.  I'm not sure if it's an issue with maven's settings.xml or if it's an issue with the plugin's pom or something.

Any help would be appreciated, and please let me know if more information (the full log or the pom or something) would be helpful.

Thanks,
   - JK

Carlos Sanchez

unread,
Oct 31, 2017, 2:39:54 PM10/31/17
to Jenkins Developers
Try running mvn package hpi:run
There is a filled issue about that if you have run clean before hpi:run

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/f03a7004-689f-4d97-a260-33caa81a0875%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jean-Karlo Accetta

unread,
Oct 31, 2017, 2:47:21 PM10/31/17
to Jenkins Developers
I had tried that earlier today, but I got the same message.  I'm not sure what else to try at this point.  I even tried simply creating a project from the hello-world archetype and trying to run that without making any changes, but it also threw the same error.

Jesse Glick

unread,
Nov 1, 2017, 7:27:33 AM11/1/17
to Jenkins Dev
On Tue, Oct 31, 2017 at 2:47 PM, Jean-Karlo Accetta
<jeankarl...@gmail.com> wrote:
> I even tried simply creating a project from
> the hello-world archetype and trying to run that without making any changes,
> but it also threw the same error.

Working for me on Linux with JDK 8 and Maven 3.5.0:

mvn archetype:generate -B -DarchetypeGroupId=io.jenkins.archetypes
-DarchetypeArtifactId=empty-plugin -DarchetypeVersion=1.2
-DartifactId=test && mvn -f test -DskipTests package hpi:run

Jean-Karlo Accetta

unread,
Nov 1, 2017, 11:05:51 AM11/1/17
to Jenkins Developers
Thanks Jesse.  I just now tried on Linux and it worked there just fine!

The error happens on my Mac (Sierra 10.12.3), also with JDK 8 and Maven 3.5.0.  I'm not really sure why it would fail on Mac, but that still helps! I can work on a Linux machine, instead.

Jesse Glick

unread,
Nov 1, 2017, 11:14:01 AM11/1/17
to Jenkins Dev
On Wed, Nov 1, 2017 at 11:05 AM, Jean-Karlo Accetta
<jeankarl...@gmail.com> wrote:
> I'm not really sure why it would fail on Mac

No idea offhand. Generally the behavior of things like this is very
similar on Linux and Mac OS X (whereas Windows behavior tends to
diverge a lot). The only common difference is the case-insensitive
filesystem.

If you run with the `-e` option you will see a full stack trace, which
would allow diagnosis if you refer to mojo source code. Requires some
familiarity with Maven to make progress that way.
Reply all
Reply to author
Forward
0 new messages