hpi:run not installing plugin..... half installed?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

hpi:run not installing plugin..... half installed?

Mez Pahlan
Hi there

I am trying to test my plugin using hpi:run which builds and compiles with no errors but I can't see my plugin in the list of plugins when using the Snippet Generator. I can see it in the list of installed plugins in the Plugin Manager but it is also not available for use in a pipeline.

Previous versions of my plugin worked fine and I can't see anything obvious that would cause this behavior. The branch I am trying to build and test is https://github.com/mezpahlan/appcenter-plugin/tree/JENKINS-58887-create-internal-tasks-and-public-tasks. This also builds on the CI server and creates an HPI. However when I try and install this manually I get no log output and no obvious errors / warnings but I still can't use my plugin. I have also tried to list the installed plugins using the Script Console which shows me the same information that the Plugin Manager does which is that my plugin is installed.

I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders. I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.

I've added an annotation processor in my POM and some new test dependencies but other than that I can't see anything obvious. Again, everything compiles and my tests pass when I'm running this as a plain Java project.

Any help is much appreciated. Thanks

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/3e3a8e2b-516e-4b19-856e-c1a0cf1bf544%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Jesse Glick-4
On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
> I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.

This is normal. The link file points to source directories rather than
needing an archive to be unpacked.

> I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.

Try specifically

mvn clean hpi:run

> I've added an annotation processor in my POM

Why? This would be extremely unusual.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1VF9D7WeVmaH6NmVUVo%3DttfZG%3Dt7oUMv45S7EX9k%3DHjQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
Thanks for the answers Jesse!

> Try specifically: mvn clean hpi:run

Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.

> Why? This would be extremely unusual.

I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).

Any further tips on attempting to track down the cause of this?

On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="BIBIlXvTAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mez....@...> wrote:
> I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.

This is normal. The link file points to source directories rather than
needing an archive to be unpacked.

> I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.

Try specifically

mvn clean hpi:run

> I've added an annotation processor in my POM

Why? This would be extremely unusual.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

slide
Are all the required plugins installed? I noticed you had several items marked as test scope in the pom.xml. 

On Wed, Sep 11, 2019, 12:17 Mez Pahlan <[hidden email]> wrote:
Thanks for the answers Jesse!

> Try specifically: mvn clean hpi:run

Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.

> Why? This would be extremely unusual.

I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).

Any further tips on attempting to track down the cause of this?

On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
> I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.

This is normal. The link file points to source directories rather than
needing an archive to be unpacked.

> I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.

Try specifically

mvn clean hpi:run

> I've added an annotation processor in my POM

Why? This would be extremely unusual.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVfeJXhTSnS05y2x-zF4f3c6g%3DOXcGLnSRt8tdKz%2B7D5VQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Matt Sicker
In reply to this post by Mez Pahlan
Jenkins bundles Guice for dependency injection, though due to some
historical API decisions, it's not that easy to use in practice. As
for running an annotation processor in a plugin, isn't that how
@MetaInfService, @Indexed, @Restricted, and the like, are handled at
compile time?

On Wed, Sep 11, 2019 at 2:17 PM Mez Pahlan <[hidden email]> wrote:

>
> Thanks for the answers Jesse!
>
> > Try specifically: mvn clean hpi:run
>
> Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.
>
> > Why? This would be extremely unusual.
>
> I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).
>
> Any further tips on attempting to track down the cause of this?
>
> On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
>>
>> On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
>> > I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.
>>
>> This is normal. The link file points to source directories rather than
>> needing an archive to be unpacked.
>>
>> > I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.
>>
>> Try specifically
>>
>> mvn clean hpi:run
>>
>> > I've added an annotation processor in my POM
>>
>> Why? This would be extremely unusual.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAEot4ozcbAdcwNRsri1O9RU5mdR4U_Q8NPT%2Bz1r-JMP%2BGEE7ew%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
Hi Matt

I don't have any experience with Guice but do with Dagger 2. I did try and understand the differences but there wasn't a lot of guidance on how to use it within Jenkins so I started to implement the Dagger 2 alternative. It worked in the IDE in the sense that it compiled correctly and tests that I had written in Java to exercise the functionality of my plugin also work.

> As for running an annotation processor in a plugin, isn't that how @MetaInfService, @Indexed, @Restricted, and the like, are handled at compile time? 

Errr...... pass. I don't know about these. Are you saying I should use these instead or that I am OK to use an annotation processor as these are examples of where ones are already in use?

For some clarity Dagger 2 uses a compile time annotation processor to generate code.

Hope that helps and thanks.

On Wednesday, 11 September 2019 20:22:31 UTC+1, Matt Sicker wrote:
Jenkins bundles Guice for dependency injection, though due to some
historical API decisions, it's not that easy to use in practice. As
for running an annotation processor in a plugin, isn't that how
@MetaInfService, @Indexed, @Restricted, and the like, are handled at
compile time?

On Wed, Sep 11, 2019 at 2:17 PM Mez Pahlan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="I52jZUfmAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mez....@...> wrote:

>
> Thanks for the answers Jesse!
>
> > Try specifically: mvn clean hpi:run
>
> Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.
>
> > Why? This would be extremely unusual.
>
> I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).
>
> Any further tips on attempting to track down the cause of this?
>
> On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
>>
>> On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
>> > I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.
>>
>> This is normal. The link file points to source directories rather than
>> needing an archive to be unpacked.
>>
>> > I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.
>>
>> Try specifically
>>
>> mvn clean hpi:run
>>
>> > I've added an annotation processor in my POM
>>
>> Why? This would be extremely unusual.
>
> --
> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="I52jZUfmAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkin...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Gavin Mogan
The pipeline steps are annotations symbols right? @Extension for the step, and @Symbol for the short name
Would an extra annotation parser cause any issue? I would guess they are non destructive and able to overlap quite easily.

What error are you getting when you are trying to use steps?

Also check your plugin manager ui, it often lets you know if things failed to load, sometimes if you are lucky, why they failed to load.

Gavin

On Wed, Sep 11, 2019 at 12:35 PM Mez Pahlan <[hidden email]> wrote:
Hi Matt

I don't have any experience with Guice but do with Dagger 2. I did try and understand the differences but there wasn't a lot of guidance on how to use it within Jenkins so I started to implement the Dagger 2 alternative. It worked in the IDE in the sense that it compiled correctly and tests that I had written in Java to exercise the functionality of my plugin also work.

> As for running an annotation processor in a plugin, isn't that how @MetaInfService, @Indexed, @Restricted, and the like, are handled at compile time? 

Errr...... pass. I don't know about these. Are you saying I should use these instead or that I am OK to use an annotation processor as these are examples of where ones are already in use?

For some clarity Dagger 2 uses a compile time annotation processor to generate code.

Hope that helps and thanks.

On Wednesday, 11 September 2019 20:22:31 UTC+1, Matt Sicker wrote:
Jenkins bundles Guice for dependency injection, though due to some
historical API decisions, it's not that easy to use in practice. As
for running an annotation processor in a plugin, isn't that how
@MetaInfService, @Indexed, @Restricted, and the like, are handled at
compile time?

On Wed, Sep 11, 2019 at 2:17 PM Mez Pahlan <[hidden email]> wrote:

>
> Thanks for the answers Jesse!
>
> > Try specifically: mvn clean hpi:run
>
> Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.
>
> > Why? This would be extremely unusual.
>
> I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).
>
> Any further tips on attempting to track down the cause of this?
>
> On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
>>
>> On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
>> > I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.
>>
>> This is normal. The link file points to source directories rather than
>> needing an archive to be unpacked.
>>
>> > I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.
>>
>> Try specifically
>>
>> mvn clean hpi:run
>>
>> > I've added an annotation processor in my POM
>>
>> Why? This would be extremely unusual.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuukkiXiqpLovws7SjNiSX16Csm1suTXD026iwKzqKS%2BQg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
In reply to this post by slide
Hi Slide

Good question. They have been like that since before this branch of the plugin I am working on. Do you think I've not got the correct ones? Or they're in the wrong scope?

On Wednesday, 11 September 2019 20:22:21 UTC+1, slide wrote:
Are all the required plugins installed? I noticed you had several items marked as test scope in the pom.xml. 

On Wed, Sep 11, 2019, 12:17 Mez Pahlan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="m4UQJUXmAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mez....@...> wrote:
Thanks for the answers Jesse!

> Try specifically: mvn clean hpi:run

Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.

> Why? This would be extremely unusual.

I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).

Any further tips on attempting to track down the cause of this?

On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
> I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.

This is normal. The link file points to source directories rather than
needing an archive to be unpacked.

> I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.

Try specifically

mvn clean hpi:run

> I've added an annotation processor in my POM

Why? This would be extremely unusual.

--
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 <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="m4UQJUXmAgAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkin...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/63bfd923-0010-4c4f-8f8b-dc7ce3135c01%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Matt Sicker
In reply to this post by Mez Pahlan
On Wed, Sep 11, 2019 at 2:35 PM Mez Pahlan <[hidden email]> wrote:
> > As for running an annotation processor in a plugin, isn't that how @MetaInfService, @Indexed, @Restricted, and the like, are handled at compile time?
>
> Errr...... pass. I don't know about these. Are you saying I should use these instead or that I am OK to use an annotation processor as these are examples of where ones are already in use?

I'm just thinking out loud. Those are annotations used in Jenkins that
use an annotation processor, so in theory, you should be able to use
additional annotation processors like the one in Dagger2.


--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAEot4oyq1Zd5vpey_21y8K3R1OB5K-ame6div2Bs6b0T%2Bs2QDg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
In reply to this post by Gavin Mogan
Hi Gavin


I'm not getting an error which is the tricky bit. Here are some screenshots (hopefully you can click to enlarge, let me know if not).

Here's the plugin in the Plugin Manager:



Screenshot from 2019-09-11 20-49-10.png


And here's the list of build steps my plugin used to appear in but doesn't. It used to be second in this list.


Screenshot from 2019-09-11 20-48-48.png





On Wednesday, 11 September 2019 20:39:38 UTC+1, Gavin Mogan wrote:
The pipeline steps are annotations symbols right? @Extension for the step, and @Symbol for the short name
Would an extra annotation parser cause any issue? I would guess they are non destructive and able to overlap quite easily.

What error are you getting when you are trying to use steps?

Also check your plugin manager ui, it often lets you know if things failed to load, sometimes if you are lucky, why they failed to load.

Gavin

On Wed, Sep 11, 2019 at 12:35 PM Mez Pahlan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="W_nFhDbnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mez....@...> wrote:
Hi Matt

I don't have any experience with Guice but do with Dagger 2. I did try and understand the differences but there wasn't a lot of guidance on how to use it within Jenkins so I started to implement the Dagger 2 alternative. It worked in the IDE in the sense that it compiled correctly and tests that I had written in Java to exercise the functionality of my plugin also work.

> As for running an annotation processor in a plugin, isn't that how @MetaInfService, @Indexed, @Restricted, and the like, are handled at compile time? 

Errr...... pass. I don't know about these. Are you saying I should use these instead or that I am OK to use an annotation processor as these are examples of where ones are already in use?

For some clarity Dagger 2 uses a compile time annotation processor to generate code.

Hope that helps and thanks.

On Wednesday, 11 September 2019 20:22:31 UTC+1, Matt Sicker wrote:
Jenkins bundles Guice for dependency injection, though due to some
historical API decisions, it's not that easy to use in practice. As
for running an annotation processor in a plugin, isn't that how
@MetaInfService, @Indexed, @Restricted, and the like, are handled at
compile time?

On Wed, Sep 11, 2019 at 2:17 PM Mez Pahlan <[hidden email]> wrote:

>
> Thanks for the answers Jesse!
>
> > Try specifically: mvn clean hpi:run
>
> Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.
>
> > Why? This would be extremely unusual.
>
> I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).
>
> Any further tips on attempting to track down the cause of this?
>
> On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
>>
>> On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
>> > I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.
>>
>> This is normal. The link file points to source directories rather than
>> needing an archive to be unpacked.
>>
>> > I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.
>>
>> Try specifically
>>
>> mvn clean hpi:run
>>
>> > I've added an annotation processor in my POM
>>
>> Why? This would be extremely unusual.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="W_nFhDbnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkin...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7fe48fea-9cae-4767-864e-496534dc1d70%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
I tried removing the following from my POM which had the effect of making my plugin visible again in the snippet generator.

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>2.24</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

I got this from the Dagger 2 README Maven setup section. So this definitely narrows down the cause of the missing plugin. Unfortunately I need this included in some form or the other. Are there any special settings I can add to this to ensure that the dagger-compiler runs but doesn't break the packaging of the plugin?

Thanks

On Wednesday, 11 September 2019 20:54:01 UTC+1, Mez Pahlan wrote:
Hi Gavin


I'm not getting an error which is the tricky bit. Here are some screenshots (hopefully you can click to enlarge, let me know if not).

Here's the plugin in the Plugin Manager:



Screenshot from 2019-09-11 20-49-10.png


And here's the list of build steps my plugin used to appear in but doesn't. It used to be second in this list.


Screenshot from 2019-09-11 20-48-48.png





On Wednesday, 11 September 2019 20:39:38 UTC+1, Gavin Mogan wrote:
The pipeline steps are annotations symbols right? @Extension for the step, and @Symbol for the short name
Would an extra annotation parser cause any issue? I would guess they are non destructive and able to overlap quite easily.

What error are you getting when you are trying to use steps?

Also check your plugin manager ui, it often lets you know if things failed to load, sometimes if you are lucky, why they failed to load.

Gavin

On Wed, Sep 11, 2019 at 12:35 PM Mez Pahlan <[hidden email]> wrote:
Hi Matt

I don't have any experience with Guice but do with Dagger 2. I did try and understand the differences but there wasn't a lot of guidance on how to use it within Jenkins so I started to implement the Dagger 2 alternative. It worked in the IDE in the sense that it compiled correctly and tests that I had written in Java to exercise the functionality of my plugin also work.

> As for running an annotation processor in a plugin, isn't that how @MetaInfService, @Indexed, @Restricted, and the like, are handled at compile time? 

Errr...... pass. I don't know about these. Are you saying I should use these instead or that I am OK to use an annotation processor as these are examples of where ones are already in use?

For some clarity Dagger 2 uses a compile time annotation processor to generate code.

Hope that helps and thanks.

On Wednesday, 11 September 2019 20:22:31 UTC+1, Matt Sicker wrote:
Jenkins bundles Guice for dependency injection, though due to some
historical API decisions, it's not that easy to use in practice. As
for running an annotation processor in a plugin, isn't that how
@MetaInfService, @Indexed, @Restricted, and the like, are handled at
compile time?

On Wed, Sep 11, 2019 at 2:17 PM Mez Pahlan <[hidden email]> wrote:

>
> Thanks for the answers Jesse!
>
> > Try specifically: mvn clean hpi:run
>
> Same issue. Builds fine no obvious errors in the terminal output and Jenkins starts normally. Plugin is listed in the list of installed plugins but I cannot use it in a Pipeline or Freestyle job.
>
> > Why? This would be extremely unusual.
>
> I'm using Dagger 2 for dependency injection because 1) I'm used to using it in other Java projects 2) whilst I've been developing the plugin in the IDE it just worked 3) I am not aware of any banned / incompatible Java libraries that we must not use (but obviously I am happy to be corrected on this).
>
> Any further tips on attempting to track down the cause of this?
>
> On Wednesday, 11 September 2019 14:38:04 UTC+1, Jesse Glick wrote:
>>
>> On Wed, Sep 11, 2019 at 3:20 AM Mez Pahlan <[hidden email]> wrote:
>> > I've looked at the local work directory in my IDE that is created when hpi:run is executed and I can see a file called appcenter.hpl but there isn't an expanded folder called appcenter in the way that other plugins have expanded folders.
>>
>> This is normal. The link file points to source directories rather than
>> needing an archive to be unpacked.
>>
>> > I have also tried running the mvn hpi:run command from outside of the IDE and I get the same issue.
>>
>> Try specifically
>>
>> mvn clean hpi:run
>>
>> > I've added an annotation processor in my POM
>>
>> Why? This would be extremely unusual.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c413ae0c-d0eb-4d56-8698-f6eae88664a8%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8b6652ce-7e33-499f-8b81-1dea042d2dc7%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Jesse Glick-4
On Wed, Sep 11, 2019 at 4:19 PM Mez Pahlan <[hidden email]> wrote:

> I tried removing the following from my POM which had the effect of making my plugin visible again in the snippet generator.
>
> <build>
>     <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                 <annotationProcessorPaths>
>                     <path>
>                         <groupId>com.google.dagger</groupId>
>                         <artifactId>dagger-compiler</artifactId>
>                         <version>2.24</version>
>                     </path>
>                 </annotationProcessorPaths>
>             </configuration>
>         </plugin>
>     </plugins>
> </build>

Well I checked this artifact and it does define the expected
`META-INF/services/javax.annotation.processing.Processor`. Have you
tried just adding a `provided`-scope dependency on that, as is
suggested for old mojo versions, rather than configuring
`maven-compiler-plugin`? That should make everything work, at the
minor cost of allowing the build to proceed even if you accidentally
linked against a class in that artifact.

You can see at

https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths

that the suggested configuration *blocks* the compiler from using
standard processors, and Jenkins relies on a bunch of them.

In other words: the Dagger recommendation for new mojo versions is, at
best, incomplete, and arguably very bad advice. It ought to say that
you can use `annotationProcessorPaths` only if you are using a new
mojo, and either know for a fact that your project uses no other
annotation processors, or are willing to enumerate them all in the
POM.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0j-O%3DTCNowiF%2BZ9Mvm5_4Ptt3FqSMrVV-BFhx3fJyBQQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: hpi:run not installing plugin..... half installed?

Mez Pahlan
> Have you tried just adding a `provided`-scope dependency on that, as is suggested for old mojo versions, rather than configuring `maven-compiler-plugin`?

Brilliant! Thanks this did the trick. I removed the whole build block and added the dagger-compiler as a provided dependency and now everything works as I expect.

Fantastic. Thanks for the help Jesse! And thanks everyone else too!

On Wednesday, 11 September 2019 21:46:15 UTC+1, Jesse Glick wrote:
On Wed, Sep 11, 2019 at 4:19 PM Mez Pahlan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="U0CUFNnqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mez....@...> wrote:

> I tried removing the following from my POM which had the effect of making my plugin visible again in the snippet generator.
>
> <build>
>     <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <configuration>
>                 <annotationProcessorPaths>
>                     <path>
>                         <groupId>com.google.dagger</groupId>
>                         <artifactId>dagger-compiler</artifactId>
>                         <version>2.24</version>
>                     </path>
>                 </annotationProcessorPaths>
>             </configuration>
>         </plugin>
>     </plugins>
> </build>

Well I checked this artifact and it does define the expected
`META-INF/services/javax.annotation.processing.Processor`. Have you
tried just adding a `provided`-scope dependency on that, as is
suggested for old mojo versions, rather than configuring
`maven-compiler-plugin`? That should make everything work, at the
minor cost of allowing the build to proceed even if you accidentally
linked against a class in that artifact.

You can see at

<a href="https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmaven.apache.org%2Fplugins%2Fmaven-compiler-plugin%2Fcompile-mojo.html%23annotationProcessorPaths\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE7w80MaMwQfmFvve1trx7QIyCATw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fmaven.apache.org%2Fplugins%2Fmaven-compiler-plugin%2Fcompile-mojo.html%23annotationProcessorPaths\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE7w80MaMwQfmFvve1trx7QIyCATw&#39;;return true;">https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths

that the suggested configuration *blocks* the compiler from using
standard processors, and Jenkins relies on a bunch of them.

In other words: the Dagger recommendation for new mojo versions is, at
best, incomplete, and arguably very bad advice. It ought to say that
you can use `annotationProcessorPaths` only if you are using a new
mojo, and either know for a fact that your project uses no other
annotation processors, or are willing to enumerate them all in the
POM.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/763cd817-27e1-4a4c-9245-7c09310ffd4b%40googlegroups.com.