gpt4 book ai didi

maven - 如果文件不存在,如何激活 Maven 配置文件?

转载 作者:行者123 更新时间:2023-12-04 12:12:44 25 4
gpt4 key购买 nike

我正在使用 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>

最佳答案

http://maven.apache.org/ref/3.3.3//maven-model/maven.html#class_file

<missing>${basedir}/src/main/myfile</missing>

关于maven - 如果文件不存在,如何激活 Maven 配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30649044/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com