Dav*_*e A 4 profile file-exists maven-3 maven
我正在使用 Maven 3.2.3。如果文件系统上不存在文件,如何激活配置文件?我已经尝试了以下,但发现<not>不支持该语法:
<profile>
<id>create-test-mysql-props-file</id>
<activation>
<file>
<not><exists>${basedir}/src/main/myfile</exists></not>
</file>
</activation>
<build>
<plugins>
<!-- Generate mysql datasource properties -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<configuration>
<outputFile>
${project.build.outputDirectory}/mysql_datasource.properties
</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Run Code Online (Sandbox Code Playgroud)
见http://maven.apache.org/ref/3.3.3//maven-model/maven.html#class_file
<missing>${basedir}/src/main/myfile</missing>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3037 次 |
| 最近记录: |