You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2005/11/26 00:46:46 UTC
svn commit: r349037 - /maven/maven-1/plugins/trunk/announcement/plugin.jelly
Author: ltheussl
Date: Fri Nov 25 15:46:44 2005
New Revision: 349037
URL: http://svn.apache.org/viewcvs?rev=349037&view=rev
Log:
Replace context.getVariable by maven:get
Modified:
maven/maven-1/plugins/trunk/announcement/plugin.jelly
Modified: maven/maven-1/plugins/trunk/announcement/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/plugin.jelly?rev=349037&r1=349036&r2=349037&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/announcement/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/announcement/plugin.jelly Fri Nov 25 15:46:44 2005
@@ -42,7 +42,11 @@
<!-- If from email address is empty, find the first non empty email
address from the POM. -->
- <j:if test="${context.getVariable('maven.announcement.mail.from') == null}">
+ <maven:get
+ var="maven.announcement.mail.from"
+ plugin="maven-announcement-plugin"
+ property="maven.announcement.mail.from"/>
+ <j:if test="${maven.announcement.mail.from == null}">
<j:forEach var="developer" items="${pom.developers}">
<j:if test="${not empty(developer.email)}">
<j:set var="maven.announcement.mail.from" value="${developer.email}"/>
@@ -213,8 +217,12 @@
<maven:param-check value="${maven.announcement.mail.to}" fail="true">The To address must be specified using the maven.announcement.mail.to property</maven:param-check>
<!-- Resolve dynamic %% templates from maven.announcement.mail.subject -->
+ <maven:get
+ var="maven.announcement.mail.subject"
+ plugin="maven-announcement-plugin"
+ property="maven.announcement.mail.subject"/>
<j:set var="maven.announcement.mail.subject"
- value="${stringUtils.replace(context.getVariable('maven.announcement.mail.subject'), '%VERSION%', versionVariable)}"/>
+ value="${stringUtils.replace(maven.announcement.mail.subject, '%VERSION%', versionVariable)}"/>
<echo>Sending mail using SMTP server "${maven.announcement.mail.server}", client ${maven.announcement.mail.client} and subject "${maven.announcement.mail.subject}"...</echo>
<echo>Sending from "${maven.announcement.mail.from}" to "${maven.announcement.mail.to}"...</echo>
Re: svn commit: r349037 - /maven/maven-1/plugins/trunk/announcement/plugin.jelly
Posted by Brett Porter <br...@apache.org>.
Lukas,
Are you sure this works?
Dotted vars generally get treated as object references when used like
below, I thought, and the blow is actually longer :) maven:get was
really meant to peek and poke other plugins, not itself.
Cheers,
Brett
ltheussl@apache.org wrote:
> Author: ltheussl
> Date: Fri Nov 25 15:46:44 2005
> New Revision: 349037
>
> URL: http://svn.apache.org/viewcvs?rev=349037&view=rev
> Log:
> Replace context.getVariable by maven:get
>
> Modified:
> maven/maven-1/plugins/trunk/announcement/plugin.jelly
>
> Modified: maven/maven-1/plugins/trunk/announcement/plugin.jelly
> URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/plugin.jelly?rev=349037&r1=349036&r2=349037&view=diff
> ==============================================================================
> --- maven/maven-1/plugins/trunk/announcement/plugin.jelly (original)
> +++ maven/maven-1/plugins/trunk/announcement/plugin.jelly Fri Nov 25 15:46:44 2005
> @@ -42,7 +42,11 @@
>
> <!-- If from email address is empty, find the first non empty email
> address from the POM. -->
> - <j:if test="${context.getVariable('maven.announcement.mail.from') == null}">
> + <maven:get
> + var="maven.announcement.mail.from"
> + plugin="maven-announcement-plugin"
> + property="maven.announcement.mail.from"/>
> + <j:if test="${maven.announcement.mail.from == null}">
> <j:forEach var="developer" items="${pom.developers}">
> <j:if test="${not empty(developer.email)}">
> <j:set var="maven.announcement.mail.from" value="${developer.email}"/>
> @@ -213,8 +217,12 @@
> <maven:param-check value="${maven.announcement.mail.to}" fail="true">The To address must be specified using the maven.announcement.mail.to property</maven:param-check>
>
> <!-- Resolve dynamic %% templates from maven.announcement.mail.subject -->
> + <maven:get
> + var="maven.announcement.mail.subject"
> + plugin="maven-announcement-plugin"
> + property="maven.announcement.mail.subject"/>
> <j:set var="maven.announcement.mail.subject"
> - value="${stringUtils.replace(context.getVariable('maven.announcement.mail.subject'), '%VERSION%', versionVariable)}"/>
> + value="${stringUtils.replace(maven.announcement.mail.subject, '%VERSION%', versionVariable)}"/>
>
> <echo>Sending mail using SMTP server "${maven.announcement.mail.server}", client ${maven.announcement.mail.client} and subject "${maven.announcement.mail.subject}"...</echo>
> <echo>Sending from "${maven.announcement.mail.from}" to "${maven.announcement.mail.to}"...</echo>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r349037 - /maven/maven-1/plugins/trunk/announcement/plugin.jelly
Posted by Lukas Theussl <lt...@apache.org>.
I was thinking about this thread:
http://www.mail-archive.com/dev@maven.apache.org/msg44176.html
and thought I'd be on the safer side with maven:get. I didn't know about
the problem with dots, I'll revert my commit.
Thanks for the watch-out!
-Lukas
Arnaud HERITIER wrote:
> In theory if you are reading properties in the current plugin you don't need
> to use maven:get
> You can access to them with ${my.property}
>
> But be careful it works only with properties for the current plugin
> If you need to create a new variable in your script you musn't use dots (.)
> in its name.
>
> Arnaud
>
> On 11/26/05, ltheussl@apache.org <lt...@apache.org> wrote:
>
>>Author: ltheussl
>>Date: Fri Nov 25 15:46:44 2005
>>New Revision: 349037
>>
>>URL: http://svn.apache.org/viewcvs?rev=349037&view=rev
>>Log:
>>Replace context.getVariable by maven:get
>>
>>Modified:
>> maven/maven-1/plugins/trunk/announcement/plugin.jelly
>>
>>Modified: maven/maven-1/plugins/trunk/announcement/plugin.jelly
>>URL:
>>http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/plugin.jelly?rev=349037&r1=349036&r2=349037&view=diff
>>
>>==============================================================================
>>--- maven/maven-1/plugins/trunk/announcement/plugin.jelly (original)
>>+++ maven/maven-1/plugins/trunk/announcement/plugin.jelly Fri Nov 25
>>15:46:44 2005
>>@@ -42,7 +42,11 @@
>>
>> <!-- If from email address is empty, find the first non empty email
>> address from the POM. -->
>>- <j:if test="${context.getVariable('maven.announcement.mail.from') ==
>>null}">
>>+ <maven:get
>>+ var="maven.announcement.mail.from"
>>+ plugin="maven-announcement-plugin"
>>+ property="maven.announcement.mail.from"/>
>>+ <j:if test="${maven.announcement.mail.from == null}">
>> <j:forEach var="developer" items="${pom.developers}">
>> <j:if test="${not empty(developer.email)}">
>> <j:set var="maven.announcement.mail.from" value="${
>>developer.email}"/>
>>@@ -213,8 +217,12 @@
>> <maven:param-check value="${maven.announcement.mail.to}"
>>fail="true">The To address must be specified using the
>>maven.announcement.mail.to property</maven:param-check>
>>
>> <!-- Resolve dynamic %% templates from
>>maven.announcement.mail.subject -->
>>+ <maven:get
>>+ var="maven.announcement.mail.subject"
>>+ plugin="maven-announcement-plugin"
>>+ property="maven.announcement.mail.subject"/>
>> <j:set var="maven.announcement.mail.subject"
>>- value="${stringUtils.replace(context.getVariable('
>>maven.announcement.mail.subject'), '%VERSION%', versionVariable)}"/>
>>+ value="${stringUtils.replace(maven.announcement.mail.subject,
>>'%VERSION%', versionVariable)}"/>
>>
>> <echo>Sending mail using SMTP server "${
>>maven.announcement.mail.server}", client ${maven.announcement.mail.client}
>>and subject "${maven.announcement.mail.subject}"...</echo>
>> <echo>Sending from "${maven.announcement.mail.from}" to "${
>>maven.announcement.mail.to}"...</echo>
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r349037 - /maven/maven-1/plugins/trunk/announcement/plugin.jelly
Posted by Arnaud HERITIER <ah...@gmail.com>.
In theory if you are reading properties in the current plugin you don't need
to use maven:get
You can access to them with ${my.property}
But be careful it works only with properties for the current plugin
If you need to create a new variable in your script you musn't use dots (.)
in its name.
Arnaud
On 11/26/05, ltheussl@apache.org <lt...@apache.org> wrote:
>
> Author: ltheussl
> Date: Fri Nov 25 15:46:44 2005
> New Revision: 349037
>
> URL: http://svn.apache.org/viewcvs?rev=349037&view=rev
> Log:
> Replace context.getVariable by maven:get
>
> Modified:
> maven/maven-1/plugins/trunk/announcement/plugin.jelly
>
> Modified: maven/maven-1/plugins/trunk/announcement/plugin.jelly
> URL:
> http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/plugin.jelly?rev=349037&r1=349036&r2=349037&view=diff
>
> ==============================================================================
> --- maven/maven-1/plugins/trunk/announcement/plugin.jelly (original)
> +++ maven/maven-1/plugins/trunk/announcement/plugin.jelly Fri Nov 25
> 15:46:44 2005
> @@ -42,7 +42,11 @@
>
> <!-- If from email address is empty, find the first non empty email
> address from the POM. -->
> - <j:if test="${context.getVariable('maven.announcement.mail.from') ==
> null}">
> + <maven:get
> + var="maven.announcement.mail.from"
> + plugin="maven-announcement-plugin"
> + property="maven.announcement.mail.from"/>
> + <j:if test="${maven.announcement.mail.from == null}">
> <j:forEach var="developer" items="${pom.developers}">
> <j:if test="${not empty(developer.email)}">
> <j:set var="maven.announcement.mail.from" value="${
> developer.email}"/>
> @@ -213,8 +217,12 @@
> <maven:param-check value="${maven.announcement.mail.to}"
> fail="true">The To address must be specified using the
> maven.announcement.mail.to property</maven:param-check>
>
> <!-- Resolve dynamic %% templates from
> maven.announcement.mail.subject -->
> + <maven:get
> + var="maven.announcement.mail.subject"
> + plugin="maven-announcement-plugin"
> + property="maven.announcement.mail.subject"/>
> <j:set var="maven.announcement.mail.subject"
> - value="${stringUtils.replace(context.getVariable('
> maven.announcement.mail.subject'), '%VERSION%', versionVariable)}"/>
> + value="${stringUtils.replace(maven.announcement.mail.subject,
> '%VERSION%', versionVariable)}"/>
>
> <echo>Sending mail using SMTP server "${
> maven.announcement.mail.server}", client ${maven.announcement.mail.client}
> and subject "${maven.announcement.mail.subject}"...</echo>
> <echo>Sending from "${maven.announcement.mail.from}" to "${
> maven.announcement.mail.to}"...</echo>
>
>
>