1.报错实例:

Caused by: java.lang.ClassNotFoundException: liquibase.exception.ChangeLogParseException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 15 common frames omitted
16:23:44.960 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
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 88, column 23:
        mavenProjectName: @project.artifactId@

2.报错原因:

artifactId是maven属性,我们知道使用mavne属性是使用${}的方式,为什么上面使用@@的方式呢,这是因为为了避免与SpringBoot的变量冲突。

2.解决问题:

如何达到上述目的呢?

<build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
           </resource>
        </resources>
        <plugins>
           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <delimiters>
                        <delimiter>@</delimiter>
                    </delimiters>
                    <useDefaultDelimiters>false</useDefaultDelimiters>
                </configuration>
            </plugin>
        </plugins>
</build>