Thanks Harsh,

Could you please share with us an example of using maven pipeline details
in email generated by the email ext plug-in that I would add to the
documentation?

Le lun. 22 avr. 2019 à 08:49, Harsh Shah <[email protected]> a écrit :

> Collection<org.jenkinsci.plugins.pipeline.maven.MavenArtifact>
> generatedArtifacts =
> currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class).getGeneratedArtifacts();
>                     for
> (org.jenkinsci.plugins.pipeline.maven.MavenArtifact
> generatedArtifact:generatedArtifacts) {
>                         if (generatedArtifact.isDeployed()) {
>                             println("<a href='" +
> generatedArtifact.getUrl() + "'>" + generatedArtifact.getShortDescription()
> + "</a>");
>                         } else {
>
> println(generatedArtifact.getShortDescription());
>                         }
>                     }
>
> On Sunday, April 21, 2019 at 11:48:03 PM UTC-7, Harsh Shah wrote:
>>
>> Hi,
>>   Thanks, this works.
>>
>> -Harsh
>>
>> On Sunday, April 21, 2019 at 9:15:50 AM UTC-7, Cyrille Le Clerc wrote:
>>>
>>> Hello Harsh,
>>>
>>>
>>> This seems to be possible but I have not tried. It should look like:
>>>
>>> Collection<org.jenkinsci.plugins.pipeline.maven.MavenArtifact>
>>> generatedArtifacts = build.getAction(org.jenkinsci.plugins.pipeline.
>>> maven.publishers.MavenReport.class).getGeneratedArtifacts();
>>>
>>> for (MavenArtifact generatedArtifact:generatedArtifacts) {
>>>     if (generatedArtifact.isDeployed()) {
>>>         System.out.println("<a href='" + generatedArtifact.getUrl() +
>>> "'>" + generatedArtifact.getShortDescription() + "</a>");
>>>     } else {
>>>         System.out.println(generatedArtifact.getShortDescription());
>>>     }
>>> }
>>>
>>>
>>> See source code
>>> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.6.9/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenArtifact.java
>>>
>>> Cyrille
>>>
>>> On Friday, April 19, 2019 at 7:06:01 PM UTC+2, Harsh Shah wrote:
>>>>
>>>> The template is a pretty standard template like this
>>>> https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&modificationDate=1332562186000&api=v2
>>>> I am trying to get maven artifacts urls
>>>>
>>>>     <!-- MAVEN ARTIFACTS -->
>>>>     <j:set var="mbuilds" value="${build.moduleBuilds}" />
>>>>     <j:if test="${mbuilds!=null}">
>>>>       <div class="content">
>>>>         <h1>Build Artifacts</h1>
>>>>         <j:forEach var="m" items="${mbuilds}">
>>>>           <h2>${m.key.displayName}</h2>
>>>>           <j:forEach var="mvnbld" items="${m.value}">
>>>>             <j:set var="artifacts" value="${mvnbld.artifacts}" />
>>>>             <j:if test="${artifacts!=null and artifacts.size()&gt;0}">
>>>>               <ul>
>>>>                 <j:forEach var="f" items="${artifacts}">
>>>>                   <li>
>>>>                     <a
>>>> href="${rooturl}${mvnbld.url}artifact/${f}">${f}</a>
>>>>                   </li>
>>>>                 </j:forEach>
>>>>               </ul>
>>>>             </j:if>
>>>>           </j:forEach>
>>>>         </j:forEach>
>>>>         <br />
>>>>       </div>
>>>>     </j:if>
>>>>
>>>>
>>>>
>>>> On Friday, April 19, 2019 at 9:30:49 AM UTC-7, Cyrille Le Clerc wrote:
>>>>>
>>>>> do you have examples of integrations of the email ext plugin with
>>>>> other plugins?
>>>>> Is the integration based on environment variables?
>>>>>
>>>>> Cyrille
>>>>>
>>>>> On Friday, April 19, 2019 at 2:15:11 AM UTC+2, Harsh Shah wrote:
>>>>>>
>>>>>> Hi,
>>>>>>   We have been using pipeline maven plugin and maven artifact
>>>>>> publisher to display deployed artifacts by the build.
>>>>>>
>>>>>>   We also use ext-email plugin with a template to provide
>>>>>> notifications.
>>>>>>
>>>>>> How can I get the published maven artifacts from maven artifact
>>>>>> publisher in my email description?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> -Harsh
>>>>>>
>>>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CADA0CVygkziEzy3Y82CKd95q5AU3BgDLfYghTrMe%2B1%3DMq8cz7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to