5
maven exec 플러그인으로 몇 가지 작업을 수행하려고합니다. 하나는 앱이 사용할 외부 데이터를 생성하기 위해 스크립트를 실행하는 것입니다. 두 번째는 컴파일 단계에서 일부 편의 작업을 수행하기 위해 Java 코드 덩어리를 실행하는 것입니다. 내가 실행할 때maven exec plugin에 대한 exec 및 java 목표를 모두 정의 할 수 있습니까?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>data_for_app</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/getappdata.sh</executable>
<arguments>
<argument>${basedir}/src/main/webapp/WEB-INF/xml/appdatahere/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>do_convenience</id>
<phase>compile</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.example.DoConvenienceStuff</mainClass>
<arguments>
<argument>https://example.com/data</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
는하지만 :
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project jss: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -> [Help 1]
또는 'mainClass이'누락 된 매개 변수 또는 유효하지 않은 말을 비슷한 오류 :
mvn clean package exec:exec
가 나는 오류가 발생합니다.
감사 : exec'을 -이 경우에도 SO에 대한 몇 가지 다른 답변뿐만 아니라 문서를 읽은 후 나에게 분명 아니었다! –