You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Russell Gold <ru...@oracle.com> on 2018/11/06 20:24:03 UTC

Plugin parameter for project class path?

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugin parameter for project class path?

Posted by Russell Gold <ru...@oracle.com>.
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 <rf...@apache.org> wrote:
> 
> Counter question: where should we improve the documentation?
> 
> On Thu, 08 Nov 2018 19:02:03 +0100, Russell Gold <ru...@oracle.com> wrote:
> 
>> Thanks, that was the problem :)
>> 
>>> On Nov 7, 2018, at 3:48 PM, Robert Scholte <rf...@apache.org> 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 <ru...@oracle.com> 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: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugin parameter for project class path?

Posted by Robert Scholte <rf...@apache.org>.
Counter question: where should we improve the documentation?

On Thu, 08 Nov 2018 19:02:03 +0100, Russell Gold <ru...@oracle.com>  
wrote:

> Thanks, that was the problem :)
>
>> On Nov 7, 2018, at 3:48 PM, Robert Scholte <rf...@apache.org> 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  
>> <ru...@oracle.com> 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: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugin parameter for project class path?

Posted by Russell Gold <ru...@oracle.com>.
Thanks, that was the problem :)

> On Nov 7, 2018, at 3:48 PM, Robert Scholte <rf...@apache.org> 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 <ru...@oracle.com> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugin parameter for project class path?

Posted by Robert Scholte <rf...@apache.org>.
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 <ru...@oracle.com>  
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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org