Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用maven pom.xml启动具有不同选项的同一java进程的两个实例_Java_Maven_Intellij Idea_Build_Pom.xml - Fatal编程技术网

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

使用maven pom.xml启动具有不同选项的同一java进程的两个实例,java,maven,intellij-idea,build,pom.xml,Java,Maven,Intellij Idea,Build,Pom.xml,这就是我所拥有的,它不起作用。我永远看不到进程的第二个实例正在运行 <profile> <id>myid</id> <activation> <property> <name>myid</name> </property> </activation> <build> <plugins> <plug

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

<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>

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

要使用async选项,您需要如下配置插件:

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

也考虑阅读Maven插件的配置方式。< /P>你是否使用MVN部署运行Maven?你在寻找@罗伯特斯科特吗?我认为你是对的。你能举个例子吗。谢谢