From e52be1da9a2a08345d96c1f38ad98578250097b8 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Sun, 22 May 2005 13:15:15 +0000 Subject: [PATCH] Check if pom is in the correct format. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@171311 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/transformer/AbstractPomTransformer.java | 5 +++++ .../apache/maven/plugin/transformer/VersionTransformer.java | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java index 9b07518891..964e09d278 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/AbstractPomTransformer.java @@ -187,6 +187,11 @@ public abstract class AbstractPomTransformer public void transformNodes() throws Exception { + if ( getSelectedNodes().isEmpty() ) + { + throw new Exception( "Your pom doesn't respect the standard format." ); + } + for ( Iterator i = getSelectedNodes().iterator(); i.hasNext(); ) { Object o = i.next(); diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java index 2bf92ed365..4081210b5a 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java @@ -30,8 +30,6 @@ import org.dom4j.Node; * @author Brett Porter * * @version $Id: VersionTransformer.java 115421 2004-06-01 02:20:18Z dion $ - * @todo check to make sure the basic structure of the document is good. just ran into a bug - * with the first version of the converter and the root element was not . */ public class VersionTransformer extends AbstractPomTransformer