मैं अपने पीओएम को स्थापित करने की कोशिश कर रहा हूं जैसे कि जब मैं mvn exec:exec
या mvn exec:java
करता हूं तो यह पहले स्रोत को संकलित करेगा और यदि सफल हो, तो इसे निष्पादित करें।एमवीएन निष्पादन से पहले संकलित
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<executions>
<execution>
<phase>exec</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>my.main.class</mainClass>
</configuration>
</plugin>
</plugins>
</build>
या तो mvn exec:exec ...
या mvn exec:java
यह पहली संकलन नहीं है जब मैं करते हैं:
मैं निम्नलिखित और के बारे में <execution>
हिस्सा चलती की कोशिश की है, लेकिन यह काम करने के लिए नहीं मिल सकता है। मैंने exec
प्लगइन अनुभाग में <execution>
भाग डालने का प्रयास किया है, लेकिन यह काम नहीं करता है?
अपने निष्पादन से पहले "कंपाइलर: संकलन" क्यों न चलाएं: exec/exec: java? –
@ एलाड मैं संकलन करना भूल जाता हूं और फिर भ्रमित हो जाता हूं क्यों कुछ भी नहीं बदला है। – Lerp
@Lerp एक ही समस्या का सामना करते हुए, क्या आपको कोई समाधान मिला है? – Yaroslav