mirror of https://github.com/apache/maven.git
revert <includes> and <excludes> in MDO to old format
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163666 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b022c6038f
commit
b84d4bc35e
|
@ -34,7 +34,9 @@
|
|||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/scripts</directory>
|
||||
<includes>**/*.mmld</includes>
|
||||
<includes>
|
||||
<include>**/*.mmld</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
|
|
@ -89,18 +89,29 @@
|
|||
<resources>
|
||||
<resource>
|
||||
<directory>src/test</directory>
|
||||
<includes>**/*.xml</includes>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<testResources>
|
||||
<testResource>
|
||||
<directory>src/conf</directory>
|
||||
<includes>*.xsd,*.dtd,*.mod,log4j.properties,driver.jelly,driver.properties</includes>
|
||||
<includes>
|
||||
<include>*.xsd</include>
|
||||
<include>*.dtd</include>
|
||||
<include>*.mod</include>
|
||||
<include>log4j.properties</include>
|
||||
<include>driver.jelly</include>
|
||||
<include>driver.properties</include>
|
||||
</includes>
|
||||
</testResource>
|
||||
<testResource>
|
||||
<directory>src/messages</directory>
|
||||
<targetPath>org/apache/maven/messages</targetPath>
|
||||
<includes>messages*.properties</includes>
|
||||
<includes>
|
||||
<include>messages*.properties</include>
|
||||
</includes>
|
||||
</testResource>
|
||||
</testResources>
|
||||
</build>
|
||||
|
|
|
@ -1443,7 +1443,7 @@
|
|||
<fields>
|
||||
<field>
|
||||
<name>includes</name>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.0+</version>
|
||||
<description><![CDATA[the description]]></description>
|
||||
<association>
|
||||
<type>String</type>
|
||||
|
@ -1452,25 +1452,13 @@
|
|||
</field>
|
||||
<field>
|
||||
<name>excludes</name>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.0+</version>
|
||||
<description><![CDATA[the description]]></description>
|
||||
<association>
|
||||
<type>String</type>
|
||||
<multiplicity>*</multiplicity>
|
||||
</association>
|
||||
</field>
|
||||
<field>
|
||||
<name>includes</name>
|
||||
<version>4.0.0</version>
|
||||
<description><![CDATA[the description]]></description>
|
||||
<type>String</type>
|
||||
</field>
|
||||
<field>
|
||||
<name>excludes</name>
|
||||
<version>4.0.0</version>
|
||||
<description><![CDATA[the description]]></description>
|
||||
<type>String</type>
|
||||
</field>
|
||||
</fields>
|
||||
<codeSegments>
|
||||
<codeSegment>
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.apache.maven.model.Resource;
|
|||
import org.apache.maven.plugin.AbstractPlugin;
|
||||
import org.apache.maven.plugin.PluginExecutionException;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -103,22 +104,29 @@ public class ResourcesMojo
|
|||
// If we only have a directory then we want to include
|
||||
// everything we can find within that path.
|
||||
|
||||
String includes = resource.getIncludes();
|
||||
String includesAsString = "**/**";
|
||||
|
||||
if ( includes == null || includes.length() == 0 )
|
||||
java.util.List includes = resource.getIncludes();
|
||||
if ( includes != null && includes.size() > 0 )
|
||||
{
|
||||
includes = "**/**";
|
||||
includesAsString = StringUtils.join( includes.iterator(), "," );
|
||||
}
|
||||
|
||||
String excludes = resource.getExcludes();
|
||||
List excludes = resource.getExcludes();
|
||||
|
||||
if ( excludes != null && excludes.length() > 0 )
|
||||
if ( excludes == null )
|
||||
{
|
||||
excludes += ",";
|
||||
excludes = resource.getDefaultExcludes();
|
||||
}
|
||||
else
|
||||
{
|
||||
excludes = new ArrayList( excludes );
|
||||
excludes.addAll( resource.getDefaultExcludes() );
|
||||
}
|
||||
excludes += listToString( resource.getDefaultExcludes() );
|
||||
|
||||
List files = FileUtils.getFileNames( resourceDirectory, includes, excludes, false );
|
||||
String excludesAsString = StringUtils.join( excludes.iterator(), "," );
|
||||
|
||||
List files = FileUtils.getFileNames( resourceDirectory, includesAsString, excludesAsString, false );
|
||||
|
||||
for ( Iterator j = files.iterator(); j.hasNext(); )
|
||||
{
|
||||
|
@ -140,23 +148,6 @@ public class ResourcesMojo
|
|||
return resourceEntries;
|
||||
}
|
||||
|
||||
private String listToString( List list )
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
for ( int i = 0; i < list.size(); i++ )
|
||||
{
|
||||
sb.append( list.get( i ) );
|
||||
|
||||
if ( i != list.size() - 1 )
|
||||
{
|
||||
sb.append( "," );
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static byte[] fileRead( String fileName )
|
||||
throws IOException
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue