Plugin parameter for project class path?

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

Plugin parameter for project class path?

Russell Gold-3
I am writing a plugin which does post-processing on some classes compiled in the build, so I have defined a parameter that I would like Maven to fill in with the appropriate list of dependencies, but I am clearly misunderstanding how to do that. Here is what I have:


>   @Parameter(defaultValue = "${project.compileClasspathElements}", readonly = true, required = true)
>   private List<String> compileClasspathElements;

But when the plugin executes, that is being set to the directory in which compiled classes are places. (target/classes).

What is the correct way to do this, and how should I have figured it out?

Thanks,
Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugin parameter for project class path?

rfscholte
Did you specify the requiresDependencyResolution of the @Mojo?

Robert

[1]  
https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html#Supported_Annotations
On Tue, 06 Nov 2018 21:24:03 +0100, Russell Gold <[hidden email]>  
wrote:

> I am writing a plugin which does post-processing on some classes  
> compiled in the build, so I have defined a parameter that I would like  
> Maven to fill in with the appropriate list of dependencies, but I am  
> clearly misunderstanding how to do that. Here is what I have:
>
>
>>   @Parameter(defaultValue = "${project.compileClasspathElements}",  
>> readonly = true, required = true)
>>   private List<String> compileClasspathElements;
>
> But when the plugin executes, that is being set to the directory in  
> which compiled classes are places. (target/classes).
>
> What is the correct way to do this, and how should I have figured it out?
>
> Thanks,
> Russ
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugin parameter for project class path?

Russell Gold-3
Thanks, that was the problem :)

> On Nov 7, 2018, at 3:48 PM, Robert Scholte <[hidden email]> wrote:
>
> Did you specify the requiresDependencyResolution of the @Mojo?
>
> Robert
>
> [1] https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html#Supported_Annotations
> On Tue, 06 Nov 2018 21:24:03 +0100, Russell Gold <[hidden email]> wrote:
>
>> I am writing a plugin which does post-processing on some classes compiled in the build, so I have defined a parameter that I would like Maven to fill in with the appropriate list of dependencies, but I am clearly misunderstanding how to do that. Here is what I have:
>>
>>
>>>  @Parameter(defaultValue = "${project.compileClasspathElements}", readonly = true, required = true)
>>>  private List<String> compileClasspathElements;
>>
>> But when the plugin executes, that is being set to the directory in which compiled classes are places. (target/classes).
>>
>> What is the correct way to do this, and how should I have figured it out?
>>
>> Thanks,
>> Russ
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugin parameter for project class path?

rfscholte
Counter question: where should we improve the documentation?

On Thu, 08 Nov 2018 19:02:03 +0100, Russell Gold <[hidden email]>  
wrote:

> Thanks, that was the problem :)
>
>> On Nov 7, 2018, at 3:48 PM, Robert Scholte <[hidden email]> wrote:
>>
>> Did you specify the requiresDependencyResolution of the @Mojo?
>>
>> Robert
>>
>> [1]  
>> https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html#Supported_Annotations
>> On Tue, 06 Nov 2018 21:24:03 +0100, Russell Gold  
>> <[hidden email]> wrote:
>>
>>> I am writing a plugin which does post-processing on some classes  
>>> compiled in the build, so I have defined a parameter that I would like  
>>> Maven to fill in with the appropriate list of dependencies, but I am  
>>> clearly misunderstanding how to do that. Here is what I have:
>>>
>>>
>>>>  @Parameter(defaultValue = "${project.compileClasspathElements}",  
>>>> readonly = true, required = true)
>>>>  private List<String> compileClasspathElements;
>>>
>>> But when the plugin executes, that is being set to the directory in  
>>> which compiled classes are places. (target/classes).
>>>
>>> What is the correct way to do this, and how should I have figured it  
>>> out?
>>>
>>> Thanks,
>>> Russ
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugin parameter for project class path?

Russell Gold-3
That’s a big question :)

My problem was that I wasn’t sure what the parameters meant, and what the settings meant, and most especially, what the properties available in the build are. It’s a general problem with technical docs: when you develop a feature and want to describe it, it is hard to recall exactly what a user doesn’t know; consequently, most technical docs are essentially reference manuals for people who already know how to use the product and have forgotten some details. The best experience I had in creating docs for a product happened when a tech writer *interviewed* me, asking what the product did, and how to teach him to use it.

That kind of user documentation takes a fair bit of work, of course.

> On Nov 9, 2018, at 4:53 AM, Robert Scholte <[hidden email]> wrote:
>
> Counter question: where should we improve the documentation?
>
> On Thu, 08 Nov 2018 19:02:03 +0100, Russell Gold <[hidden email]> wrote:
>
>> Thanks, that was the problem :)
>>
>>> On Nov 7, 2018, at 3:48 PM, Robert Scholte <[hidden email]> wrote:
>>>
>>> Did you specify the requiresDependencyResolution of the @Mojo?
>>>
>>> Robert
>>>
>>> [1] https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html#Supported_Annotations
>>> On Tue, 06 Nov 2018 21:24:03 +0100, Russell Gold <[hidden email]> wrote:
>>>
>>>> I am writing a plugin which does post-processing on some classes compiled in the build, so I have defined a parameter that I would like Maven to fill in with the appropriate list of dependencies, but I am clearly misunderstanding how to do that. Here is what I have:
>>>>
>>>>
>>>>> @Parameter(defaultValue = "${project.compileClasspathElements}", readonly = true, required = true)
>>>>> private List<String> compileClasspathElements;
>>>>
>>>> But when the plugin executes, that is being set to the directory in which compiled classes are places. (target/classes).
>>>>
>>>> What is the correct way to do this, and how should I have figured it out?
>>>>
>>>> Thanks,
>>>> Russ
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]