我正在编写一个小项目来了解Maven和Spring Framework。要运行我的项目,我运行以下命令:
date = pd.to_datetime(df["FileReceivedTime"], format="%Y%m%d%").dt.strftime('%Y/%m/%d')
运行此命令时是否有办法使inputFolder参数成为必需参数?
感谢。
答案 0 :(得分:3)
Maven Enforcer Plugin可用于要求为您的构建配置属性。 requireProperty规则将完成这项工作。
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>enforce-property</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>inputFolder</property>
<message>inputFolder property must be set</message>
</requireProperty>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>