gpt4 book ai didi

java - 使用 maven pom.xml 使用不同选项启动同一 java 进程的两个实例

转载 作者:行者123 更新时间:2023-12-02 10:26:45 25 4
gpt4 key购买 nike

这是我所拥有的,但不起作用。我永远看不到该进程的第二个实例正在运行。

<profile>
<id>myid</id>
<activation>
<property>
<name>myid</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>first-execution</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<classpathScope>compile</classpathScope>
<arguments>
<argument>-Djava.net.preferIPv4Stack=true</argument>
<argument>-Ddw.logging.file.currentLogFilename=${user.home}/logs/abc_20.log</argument>
<argument>-Ddw.http.option1=5000</argument>
<argument>-Ddw.http.option2=5001</argument>
<argument>-Ddw.option3=abc1</argument>
<argument>-Ddw.Id=abcdef1</argument>
<argument>-classpath</argument>
<classpath />
<argument>com.mycompany.SomeService</argument>
<argument>server</argument>
<argument>dir1/config.yml</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>second-execution</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<classpathScope>compile</classpathScope>
<arguments>
<argument>-Djava.net.preferIPv4Stack=true</argument>
<argument>-Ddw.logging.file.currentLogFilename=${user.home}/logs/abc_21.log</argument>
<argument>-Ddw.http.option1=6000</argument>
<argument>-Ddw.http.option2=6001</argument>
<argument>-Ddw.option3=abc2</argument>
<argument>-Ddw.Id=abcdef2</argument>
<argument>-classpath</argument>
<classpath />
<argument>com.mycompany.SomeService</argument>
<argument>server</argument>
<argument>dir1/config.yml</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

任何帮助/想法/想法将不胜感激。

最佳答案

要使用异步选项,您需要像这样配置插件:

<configuration>
...
<async>true</async>
</configuration>

还可以考虑阅读https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Configuring_Parameters关于如何配置任何 Maven 插件。

关于java - 使用 maven pom.xml 使用不同选项启动同一 java 进程的两个实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53893013/

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