我有maven运行配置,我打电话给:
liquibase:rollback -Dliquibase.rollbackCount=1 -Dliquibase.clearCheckSums=true
Run Code Online (Sandbox Code Playgroud)
在运行配置本身而不是编辑配置之前,有没有办法显示一些弹出窗口来提供rollbackCount?
IntelliJ本身无法提示您输入命令行参数.但您可以通过解决方法实现此目的:
1)创建一个.bat
文件,提示您输入并创建一个简单的属性文件(假设您正在使用Windows)
@echo off
set /p id="ID: "
echo liquibase.rollbackCount=%id% > config.properties
Run Code Online (Sandbox Code Playgroud)
2)从maven加载属性文件.这使用了maven的属性插件.如果您已经在使用该插件,则不得插入依赖项.
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
</dependency>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/config.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
3)在运行maven之前执行bat
$ProjectFileDir$
和编程到您的.bat
文件在IntelliJ中运行程序时,现在应该打开命令行,批处理文件要求提供ID.然后将写入属性文件,maven执行并加载该文件.
试试这个:
Show this page
我的屏幕截图中显示的复选框command line
或其他内容 归档时间: |
|
查看次数: |
646 次 |
最近记录: |