Add Publisher Maven artifacts to mail template

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

Add Publisher Maven artifacts to mail template

Harsh Shah
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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/127d2368-aadd-4b2d-96e3-a1f8df7f2c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Cyrille Le Clerc
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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a9beb712-d828-49d2-b9b7-829e86f3551e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Harsh Shah
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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/70d2ed27-0034-45d4-a478-58c88f8f3c8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Cyrille Le Clerc
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());
    }
}



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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6ce639f4-dec4-4225-8133-57457bbec256%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Harsh Shah
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 <a href="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" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b690c83c-f461-4107-a40f-3e085d2ffd0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Harsh Shah
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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Cyrille Le Clerc
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 <[hidden email]> 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());
    }
}



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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
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 [hidden email].
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 | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Harsh Shah
Hi, Cyrille

  So this is how I do it.


pipeline side invoke the method
 
env.DEPLOYEDARTIFACTS = getDeployedArtifacts()

@NonCPS
def getDeployedArtifacts() {
    def deployed = ''
    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()) {
       
        deployed= deployed.concat(generatedArtifact.getUrl())
        deployed = deployed.concat("===")
        deployed = deployed.concat(generatedArtifact.getShortDescription())
        deployed = deployed.concat(",") 
        }

    }
    return deployed
}



In EXT-MAIL-STANDARD-TEMPLATE 

    <br />
    <!-- MAVEN ARTIFACTS -->
    <j:set var="mbuilds" value="${it.getAction('org.jenkinsci.plugins.workflow.cps.EnvActionImpl').getOverriddenEnvironment()}" />
        <h5>Deployed Artifacts</h5>
         <j:set var="generatedArtifacts" value="${mbuilds.get('DEPLOYEDArtifacts')}" />

       <table width="100%" style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
        <j:forEach var="artifacts" items="${generatedArtifacts.split(',')}" >
        <j:set var="artifact" value="${artifacts.split('===')}" />
         <tr bgcolor="white" >
          <td class="bg1" colspan="2" style="font-family: Verdana, Helvetica, sans serif; font-size: 120%; color: black">
          <li>
            <a href="${artifact[0]}">
            ${artifact[1]}
          </a>
          </li>
           </td>
         </tr>
         </j:forEach>
       </table>
 <br />



 


On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="X650_-AkCQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">shahh...@...> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="X650_-AkCQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="X650_-AkCQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">shahh...@...> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="X650_-AkCQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/aa91ddad-a68c-4551-8948-11b66dff073c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

Cyrille Le Clerc
For the record, this FAQ section: https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-HowtouseMavenbuilddataingeneratedemails

On Saturday, April 27, 2019 at 1:59:53 AM UTC+2, Harsh Shah wrote:
Hi, Cyrille

  So this is how I do it.


pipeline side invoke the method
 
env.DEPLOYEDARTIFACTS = getDeployedArtifacts()

@NonCPS
def getDeployedArtifacts() {
    def deployed = ''
    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()) {
       
        deployed= deployed.concat(generatedArtifact.getUrl())
        deployed = deployed.concat("===")
        deployed = deployed.concat(generatedArtifact.getShortDescription())
        deployed = deployed.concat(",") 
        }

    }
    return deployed
}



In EXT-MAIL-STANDARD-TEMPLATE 

    <br />
    <!-- MAVEN ARTIFACTS -->
    <j:set var="mbuilds" value="${it.getAction('org.jenkinsci.plugins.workflow.cps.EnvActionImpl').getOverriddenEnvironment()}" />
        <h5>Deployed Artifacts</h5>
         <j:set var="generatedArtifacts" value="${mbuilds.get('DEPLOYEDArtifacts')}" />

       <table width="100%" style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
        <j:forEach var="artifacts" items="${generatedArtifacts.split(',')}" >
        <j:set var="artifact" value="${artifacts.split('===')}" />
         <tr bgcolor="white" >
          <td class="bg1" colspan="2" style="font-family: Verdana, Helvetica, sans serif; font-size: 120%; color: black">
          <li>
            <a href="${artifact[0]}">
            ${artifact[1]}
          </a>
          </li>
           </td>
         </tr>
         </j:forEach>
       </table>
 <br />



 


On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/27ea3aca-0498-46df-917d-120d187de0f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

RicardF
I'm getting a null object when trying to get the deployed artifacts on command:

currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class)

do you know what am i doing wrong?

On Thursday, May 30, 2019 at 11:51:13 PM UTC+2, Cyrille Le Clerc wrote:
For the record, this FAQ section: <a href="https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-HowtouseMavenbuilddataingeneratedemails" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FPipeline%2BMaven%2BPlugin%23PipelineMavenPlugin-HowtouseMavenbuilddataingeneratedemails\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3tOtjOYXY7bnsoy-GTBqdnS0USA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FPipeline%2BMaven%2BPlugin%23PipelineMavenPlugin-HowtouseMavenbuilddataingeneratedemails\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3tOtjOYXY7bnsoy-GTBqdnS0USA&#39;;return true;">https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-HowtouseMavenbuilddataingeneratedemails

On Saturday, April 27, 2019 at 1:59:53 AM UTC+2, Harsh Shah wrote:
Hi, Cyrille

  So this is how I do it.


pipeline side invoke the method
 
env.DEPLOYEDARTIFACTS = getDeployedArtifacts()

@NonCPS
def getDeployedArtifacts() {
    def deployed = ''
    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()) {
       
        deployed= deployed.concat(generatedArtifact.getUrl())
        deployed = deployed.concat("===")
        deployed = deployed.concat(generatedArtifact.getShortDescription())
        deployed = deployed.concat(",") 
        }

    }
    return deployed
}



In EXT-MAIL-STANDARD-TEMPLATE 

    <br />
    <!-- MAVEN ARTIFACTS -->
    <j:set var="mbuilds" value="${it.getAction('org.jenkinsci.plugins.workflow.cps.EnvActionImpl').getOverriddenEnvironment()}" />
        <h5>Deployed Artifacts</h5>
         <j:set var="generatedArtifacts" value="${mbuilds.get('DEPLOYEDArtifacts')}" />

       <table width="100%" style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
        <j:forEach var="artifacts" items="${generatedArtifacts.split(',')}" >
        <j:set var="artifact" value="${artifacts.split('===')}" />
         <tr bgcolor="white" >
          <td class="bg1" colspan="2" style="font-family: Verdana, Helvetica, sans serif; font-size: 120%; color: black">
          <li>
            <a href="${artifact[0]}">
            ${artifact[1]}
          </a>
          </li>
           </td>
         </tr>
         </j:forEach>
       </table>
 <br />



 


On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d94a54be-0b5d-48a6-8a13-ba63bcd0f2bf%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Add Publisher Maven artifacts to mail template

RicardF
In reply to this post by Harsh Shah
I finally got it working (should execute it after withMaven {}.

My problem is that it shows 3 of four artifacts deployed. (jar, sources, javadoc). Pom is missing, but it gets archived into the build...

On Saturday, April 27, 2019 at 1:59:53 AM UTC+2, Harsh Shah wrote:
Hi, Cyrille

  So this is how I do it.


pipeline side invoke the method
 
env.DEPLOYEDARTIFACTS = getDeployedArtifacts()

@NonCPS
def getDeployedArtifacts() {
    def deployed = ''
    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()) {
       
        deployed= deployed.concat(generatedArtifact.getUrl())
        deployed = deployed.concat("===")
        deployed = deployed.concat(generatedArtifact.getShortDescription())
        deployed = deployed.concat(",") 
        }

    }
    return deployed
}



In EXT-MAIL-STANDARD-TEMPLATE 

    <br />
    <!-- MAVEN ARTIFACTS -->
    <j:set var="mbuilds" value="${it.getAction('org.jenkinsci.plugins.workflow.cps.EnvActionImpl').getOverriddenEnvironment()}" />
        <h5>Deployed Artifacts</h5>
         <j:set var="generatedArtifacts" value="${mbuilds.get('DEPLOYEDArtifacts')}" />

       <table width="100%" style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
        <j:forEach var="artifacts" items="${generatedArtifacts.split(',')}" >
        <j:set var="artifact" value="${artifacts.split('===')}" />
         <tr bgcolor="white" >
          <td class="bg1" colspan="2" style="font-family: Verdana, Helvetica, sans serif; font-size: 120%; color: black">
          <li>
            <a href="${artifact[0]}">
            ${artifact[1]}
          </a>
          </li>
           </td>
         </tr>
         </j:forEach>
       </table>
 <br />



 


On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
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 <[hidden email]> 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 <a href="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" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fpipeline-maven-plugin%2Fblob%2Fpipeline-maven-3.6.9%2Fjenkins-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fjenkinsci%2Fplugins%2Fpipeline%2Fmaven%2FMavenArtifact.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEmu2GQ-IUKzbIBXy5us_OqbNfPkg&#39;;return true;">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 <a href="https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1&amp;modificationDate=1332562186000&amp;api=v2" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdownload%2Fattachments%2F3604514%2Fjenkins-matrix-email-html.template%3Fversion%3D1%26modificationDate%3D1332562186000%26api%3Dv2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGAey8nrS-ptQ0lE9V2Fr3K87Suwg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/sPAYLh1W1cM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6943b6db-003f-48a7-b387-0e34e2e68bec%40googlegroups.com.