本文整理汇总了Java中org.apache.maven.shared.filtering.MavenResourcesExecution.setDelimiters方法的典型用法代码示例。如果您正苦于以下问题:Java MavenResourcesExecution.setDelimiters方法的具体用法?Java MavenResourcesExecution.setDelimiters怎么用?Java MavenResourcesExecution.setDelimiters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.shared.filtering.MavenResourcesExecution
的用法示例。
在下文中一共展示了MavenResourcesExecution.setDelimiters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDelimitersForExecution
import org.apache.maven.shared.filtering.MavenResourcesExecution; //导入方法依赖的package包/类
private void setDelimitersForExecution( MavenResourcesExecution mavenResourcesExecution )
{
// if these are NOT set, just use the defaults, which are '${*}' and '@'.
if ( delimiters != null && !delimiters.isEmpty() )
{
LinkedHashSet<String> delims = new LinkedHashSet<String>();
if ( useDefaultDelimiters )
{
delims.addAll( mavenResourcesExecution.getDelimiters() );
}
for ( String delim : delimiters )
{
if ( delim == null )
{
// FIXME: ${filter:*} could also trigger this condition. Need a better long-term solution.
delims.add( "${*}" );
}
else
{
delims.add( delim );
}
}
mavenResourcesExecution.setDelimiters( delims );
}
}
示例2: setDelimiters
import org.apache.maven.shared.filtering.MavenResourcesExecution; //导入方法依赖的package包/类
private void setDelimiters( MavenResourcesExecution mavenResourcesExecution )
{
// if these are NOT set, just use the defaults, which are '${*}' and '@'.
if ( delimiters != null && !delimiters.isEmpty() )
{
LinkedHashSet<String> delims = new LinkedHashSet<String>();
if ( useDefaultDelimiters )
{
delims.addAll( mavenResourcesExecution.getDelimiters() );
}
for ( String delim : delimiters )
{
if ( delim == null )
{
// FIXME: ${filter:*} could also trigger this condition. Need a better long-term solution.
delims.add( "${*}" );
}
else
{
delims.add( delim );
}
}
mavenResourcesExecution.setDelimiters( delims );
}
}
示例3: execute
import org.apache.maven.shared.filtering.MavenResourcesExecution; //导入方法依赖的package包/类
public void execute() throws MojoExecutionException, MojoFailureException {
try {
if (StringUtils.isEmpty(encoding) && isFilteringEnabled(getResources())) {
getLog().warn("File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
+ ", i.e. build is platform dependent!");
}
MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(getResources(),
getLarStagingDir(), getProject(), encoding, filters, Collections.<String> emptyList(),
getSession());
mavenResourcesExecution.setEscapeWindowsPaths(escapeWindowsPaths);
mavenResourcesExecution.setInjectProjectBuildFilters(useBuildFilters);
mavenResourcesExecution.setEscapeString(escapeString);
mavenResourcesExecution.setOverwrite(overwrite);
mavenResourcesExecution.setIncludeEmptyDirs(includeEmptyDirs);
mavenResourcesExecution.setSupportMultiLineFiltering(supportMultiLineFiltering);
// if these are NOT set, just use the defaults, which are '${*}' and
// '@'.
if (delimiters != null && !delimiters.isEmpty()) {
LinkedHashSet<String> delims = new LinkedHashSet<String>();
if (useDefaultDelimiters) {
delims.addAll(mavenResourcesExecution.getDelimiters());
}
for (String delim : delimiters) {
if (delim == null) {
// FIXME: ${filter:*} could also trigger this condition.
// Need a better long-term solution.
delims.add("${*}");
} else {
delims.add(delim);
}
}
mavenResourcesExecution.setDelimiters(delims);
}
if (nonFilteredFileExtensions != null) {
mavenResourcesExecution.setNonFilteredFileExtensions(nonFilteredFileExtensions);
}
mavenResourcesFiltering.filterResources(mavenResourcesExecution);
executeUserFilterComponents(mavenResourcesExecution);
} catch (MavenFilteringException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
}
示例4: filterResources
import org.apache.maven.shared.filtering.MavenResourcesExecution; //导入方法依赖的package包/类
protected void filterResources( File outputDirectory )
throws MojoExecutionException
{
Resource res = new Resource();
// TODO: Check how to prevent hard coding here?
res.setDirectory( getSourceDirectory().getAbsolutePath() );
res.setFiltering( true );
// TODO: Check if it makes sense to make this list configurable?
res.setIncludes( Collections.singletonList( "**/*" ) );
List<String> filtersFile = new ArrayList<String>();
MavenResourcesExecution execution =
new MavenResourcesExecution( Collections.singletonList( res ), outputDirectory, getMavenProject(),
getEncoding(), filtersFile, getNonFilteredFileExtensions(),
getMavenSession() );
execution.setEscapeString( getEscapeString() );
execution.setSupportMultiLineFiltering( isSupportMultiLineFiltering() );
execution.setIncludeEmptyDirs( isIncludeEmptyDirs() );
execution.setEscapeWindowsPaths( isEscapeWindowsPaths() );
execution.setFilterFilenames( isFileNameFiltering() );
//// execution.setFilters( filters );
//
// // TODO: Check if we need a parameter?
execution.setOverwrite( true );
execution.setDelimiters( getDelimiters(), isUseDefaultDelimiters() );
execution.setEncoding( getEncoding() );
//
// execution.setUseDefaultFilterWrappers( true );
if ( getNonFilteredFileExtensions() != null )
{
execution.setNonFilteredFileExtensions( getNonFilteredFileExtensions() );
}
try
{
mavenResourcesFiltering.filterResources( execution );
}
catch ( MavenFilteringException e )
{
getLog().error( "Failure during filtering.", e );
throw new MojoExecutionException( "Failure during filtering", e );
}
}