Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 在原型xml中调用replace会导致路径错误_Maven_Maven Archetype - Fatal编程技术网

Maven 在原型xml中调用replace会导致路径错误

Maven 在原型xml中调用replace会导致路径错误,maven,maven-archetype,Maven,Maven Archetype,我有“a-b-c”形式的工件ID,我希望我的原型有一个类似“a.b.c”的包。 因此,我做了以下工作: <archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="bmed-

我有“a-b-c”形式的工件ID,我希望我的原型有一个类似“a.b.c”的包。 因此,我做了以下工作:

<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="bmed-sb-archetype"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
    <requiredProperty key="package">
        <defaultValue>${StringUtils.replace(artifactId,"-","")}</defaultValue>
    </requiredProperty>
 <fileSets>
    <fileSet filtered="true" packaged="true" encoding="UTF-8">
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.java</include>
        </includes>
    </fileSet>

${StringUtils.replace(artifactId,“-”,“)}
src/main/java
**/*.爪哇
但这样做会让我:

[错误]无法在project standalone上执行目标org.apache.maven.plugins:maven原型插件:3.1.2:generate(默认cli):pom:java.io.IOException:文件名、目录名或卷标语法不正确


如果我把它取下来,一切都会好的。为什么?

为什么您的工件具有a-b-c格式

您还可以使用archetype-post-generate.groovy在最后更改结构

请参阅本页末尾的生成后脚本