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 
<https://github.com/google/dagger/blob/master/README.md#maven>. 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:
>
>
>
> [image: 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.
>
>
> [image: 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 <mez....@gmail.com> 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 <mez....@gmail.com> 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 <mez....@gmail.com> 
>>>> 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 jenkin...@googlegroups.com. 
>>>> > 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 jenkin...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/c73d39dd-8474-414e-a1d3-6f9c3a440868%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/8b6652ce-7e33-499f-8b81-1dea042d2dc7%40googlegroups.com.

Reply via email to