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
Patch that checks if the project's current version is on the POM's versions element.