Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,15 @@ public void setFolder( File folder )
this.folder = folder;
}

protected boolean atLeastOneItemFound()throws MojoExecutionException
{
return (getItemsConverted().size()>0);
}
protected boolean isMoreThanOneSet()
{
// a ^ b ^ c && ! (a && b && c)
boolean result = isItemsSet() ^ isContentSet() ^ isItemsWithPropertiesSet() ^ isFolderSet()
&& !( isItemsSet() && isContentSet() && isItemsWithPropertiesSet() && isFolderSet() );
&& !( isItemsSet() && isContentSet() && isItemsWithPropertiesSet() && isFolderSet() );
return !result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,15 @@ public void execute()
throw new MojoExecutionException( "You have to use at least one. " + "Either items element, "
+ "itemsWithProperties, content or folder element!" );
}

if ( isMoreThanOneSet() )
if(atLeastOneItemFound())
{
throw new MojoExecutionException( "You can use only one element. "
+ "Either items, itemsWithProperties, content or folder element but not more than one of them." );
if ( isMoreThanOneSet() )
{
throw new MojoExecutionException( "You can use only one element. "
+ "Either items, itemsWithProperties, content or folder element but not more than one of them." );
}
}else{
getLog().info( "The list of items to iterate on is empty. Nothing will be done..." );
}

List<Exception> exceptions = new ArrayList<>();
Expand Down