maven问题归纳

maven编译时没有替换掉@占位符

问题:

org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character ‘@’ that cannot start any token. (Do not use @ for indentation)
in ‘reader’, line 5, column 11:
name: @artifactId@
^

解决:

<build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <!--替换掉testResource下的占位符-->
                <filtering>true</filtering>
            </testResource>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </testResource>
        </testResources>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <!--替换掉resource下的占位符-->
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
        <finalName>${project.artifactId}</finalName>
    </build>

你可能感兴趣的:(MAVEN,maven)