Good day to you, Sebastien,
Note: I don't know everything about mojo parameters but i'll show what i
know so far
Here's the break down of a mojo parameter:
/**
* @parameter expression="${merge-jar-dependencies.sourcePom}"
default-value="${project.artifact}"
*/
private Aritfact sourcePom;
expression (in your case, merge-jar-dependencies.sourcePom).
`--> Used to inject a Property value to that parameter (sourcePom).
Properties may come from System / Environment Variables, POM properties,
Commandline Properties, Filter properties, or other predefined properties
(i.e project.artifact).
default-value (in your case, project.artifact)
`--> Injects a property to your parameter.
you class's field (in your case, soucePom)
`--> This is your paramater. If the first two discussed here is injected by
properties, this one is injected from the <configuration> element in your
pom. (Note: AFAIK, if you set your experssion as a predefined property such
as project.artifact, the parameter can no longer be configured in your pom)
To answer your question, since you're using a class, you use the parameter.
<project>
...
<build>
<plugins>
<plugin>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<executions>
<execution>
<configuration>
<sourcePom>
<artifactId>...</artifactId>
<groupId>...</groupId>
<version>...</version>
...
</sourcePom>
<configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
the <sourcePom> represents your sourcePom field in your class.
the elements of <sourcePom> are the fields of the Artifact.
Things I am unsure of:
1. I am not sure if <sourcePom> will work as it is. But if not, you may want
to try <sourcePom
implementation="org.apache.maven.artifact.DefaultArtifact".
2. I am not sure if "private Aritfact sourcePom" will work as well, you may
want to try DefaultArtifact.
3. Most likely, #1 & #2 will work withouth those "workarounds" i mentioned,
Im just not sure how.
4. I am not sure whether it is the fields of the Artifact that you access
with the elements of <sourcePom> or the setters.
If you find the answers to those, or if somebody out there who knows, kindly
share it with us :-)
Thanks,
Franz
Sebastien Brunot wrote:
>
> Hi all,
>
> i have a mojo that defines a parameter names sourcePom which type is
> Artifact :
>
> /**
>
> * The POM where jar dependencies are declared.
>
> *
>
> * @parameter expression="${merge-jar-dependencies.sourcePom}"
> default-value="${project.artifact}"
>
> */
>
> private Artifact sourcePom;
>
>
>
> I don't know how to specify an artifact under <configuration>
> <sourcePom> ...
>
> Thanks for your help,
>
> Sebastien
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/XML-representation-of-an-Artifact-in-the-%3Cconfiguration%3E-section-of-the-POM-tf2607681s177.html#a7277297
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]