2. เขียน java class ที่ต้องการให้ execute ขึ้นมา (ผ่าน method main (String[] args) เท่านั้น)
- ตรง <phase> ให้กำหนดเป็น compile (คือ ทำงานตอน compile)
- <mainClass> ให้ชี้ไปที่ class ที่ต้องการให้ execute
<project>
...
...
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.pamarin.learning.executor.CompileExecutor</mainClass>
<arguments>
<argument>na5cent.blogspot.com</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
...
</project>
4. clean and build


ไม่มีความคิดเห็น:
แสดงความคิดเห็น