problem with plugin tutorial

50 views
Skip to first unread message

david michael gang

unread,
Dec 12, 2012, 2:50:45 AM12/12/12
to jenkin...@googlegroups.com
Hi all,

I try to run the tutorial
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

and i get the following error while running mvn package

:mvn -e package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.jenkins-ci.plugins:hello-world:hpi:1.0-SNAPSHOT
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [hpi:validate {execution: default-validate}]
[INFO] [enforcer:display-info {execution: default}]
[INFO] Maven Version: 2.2.1
[INFO] JDK Version: 1.6.0_14 normalized as: 1.6.0-14
[INFO] OS Info: Arch: amd64 Family: unix Name: linux Version: 2.6.18-308.1.1.el5
[INFO] [localizer:generate {execution: default}]
[debug] execute contextualize
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 5 resources
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /path to file/david/home/jenkins/hello-world/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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: org.apache.maven.plugin.CompilationFailureException: Compilation failure
error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap

        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
        at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Wed Dec 12 09:44:06 IST 2012
[INFO] Final Memory: 106M/315M
[INFO] ------------------------------------------------------------------------

I saw a similar defect
https://issues.jenkins-ci.org/browse/JENKINS-13754

But it looks like it was fixed long ago
What do i wrong ?

Thanks,
David

david michael gang

unread,
Dec 12, 2012, 4:45:49 AM12/12/12
to jenkin...@googlegroups.com
Hi,

After making a little bit more research i found in the pom.xml of the hello-world
  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>1.466</version><!-- which version of Jenkins is this plugin built against? -->
  </parent>


Why is this plugin run against jenkins 1.466 if we have today jenkins 1.493
I just followed the instructions
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

What did i do wrong?

Thanks,
David

domi

unread,
Dec 12, 2012, 12:06:04 PM12/12/12
to jenkin...@googlegroups.com
You have done nothing wrong, the higher the version you inherit from, the less users will potentially be able to use your plugin.
This is the version used to inform your users about your plugins dependency to the core - if you look at a plugins documentation 
on the wiki e.g. git-plugin [1] then you see that this plugins has a minimal dependency on core 1.424
The same info is also used within the update center to inform if he is running a core which is (potentially) not compatible with a given plugin.
/Domi

domi

unread,
Dec 12, 2012, 12:07:32 PM12/12/12
to domi, jenkin...@googlegroups.com
btw. its good practice to depend on a LTS version e.g. 1.480 / 1.480.1
/Domi

david michael gang

unread,
Dec 13, 2012, 4:40:46 AM12/13/12
to jenkin...@googlegroups.com, domi
Hi,

Thanks for your advice, but id did not help.
I read again carefully what is written in the link
http://jenkins-ci.org/commit/jenkins/abeebce2230c37c1ad6bd6b5d5af615859980568

It is written that maven 3 was used.
I tried the tutorial with maven3 and it worked great.
I am just wondering why the tutorial suggests to work with maven 2.* if it does not work.
I think the tutorial
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
should be changed.

BR,
David
Reply all
Reply to author
Forward
0 new messages