The following comment has been added to this issue:

     Author: Felipe Leme
    Created: Sat, 7 Aug 2004 3:52 PM
       Body:
Here are the answers:

> 1. SNAPSHOT versions should *NOT* be defined in the <versions> tag. Only released 
> version. Thus if current version is a snapshot version I'm not sure your patch will 
> do the correct thing.

If the current version is a SNAPSHOT, it shouldn't be announced, right? In that case, 
the patch is fine.

> But then I may be wrong as I'm not sure I fully understand it...

The idea is simple: if thet user is making an annoucement for a release and the 
releases have tags (i.e., there is a <versions> element set), then the current release 
should be defined there. It follows the same principles of the current 
announcement-check, which verifies if the current version is detailed on 
xdocs/changes.xml. I agree that that these assunptions are too agressive - maybe we 
could add a flag property indicating if the user wants these checkings (if you agree 
too, please open a new Jira issue and I will provide a patch for that).

> 2. What is foundTag variable for? It doesn't seem to be used

Sorry, found and foundTag are the same

> 3. There's no point in iterating once found is true, right? Thus there should 
> probably be a <j:break/> tag

Sorry again, I wasn't aware of <j:break> (at least this I can justify - JSTL's Core 
does no provide such tag :-). 

So, I guess the correct loop should be:

<j:if test="${size(pom.versions)!=0}">
  <j:set var="foundTag" value="false"/>
  <j:forEach var="version" items="${pom.versions}">
    <j:if test="${version.id==versionVariable}">
      <j:set var="foundTag" value="true"/>
      <j:break/>
    </j:if>
  </j:forEach>
  <j:if test="${!foundTag}">

It would be even simpler if <j:break> offered a var attribute indicating if the look 
was broke or not:

<j:if test="${size(pom.versions)!=0}">
  <j:forEach var="version" items="${pom.versions}">
    <j:break var="foundTag" test="${version.id==versionVariable}"/>
  </j:forEach>
  <j:if test="${!foundTag}">

Felipe




---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPANNOUNCEMENT-14?page=comments#action_22849

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPANNOUNCEMENT-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPANNOUNCEMENT-14
    Summary: [PATCH] Check if there is a SCM tag set for the project
       Type: Improvement

     Status: Open
   Priority: Trivial

 Original Estimate: 10 minutes
 Time Spent: Unknown
  Remaining: 10 minutes

    Project: maven-announcement-plugin
   Versions:
             1.3

   Assignee: Vincent Massol
   Reporter: Felipe Leme

    Created: Tue, 3 Aug 2004 1:48 PM
    Updated: Sat, 7 Aug 2004 3:52 PM

Description:
As I mentioned earlier in the dev-list, if the POM defines a <versions> element, than 
the current version should have an equivalent <version> there, otherwise check-version 
should fail.

If that happens, announcement:check-version will show this message:

Current release (XXX) does not have an entry at the POM's versions element.

-- Felipe





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to