2012-03-22 5 views
1

우분투에서 Eclipse (Helios)를 실행 중입니다. exec Maven 플러그 인을 추가했습니다. Maven 빌드를 실행하려고하면 I/O Exception이 발생합니다.Ubuntu exce Maven Plugin

내 프로젝트 디렉토리에서 Java를 실행하려고하므로 IO 예외를 얻으십시오. 내 JAVA_HOME, MAVEN_HOME을 설정했지만 여전히 프로젝트 디렉토리에서 Java를 실행하려고합니다.

내 pom 파일 &을 예외로 추가했습니다.

<plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 

      <version>1.2</version> 
      <executions> 
       <execution> 
        <id>kilim-weave</id> 
        <phase>process-classes</phase> 

        <goals> 
         <goal>exec</goal> 
        </goals> 
       </execution> 
      </executions> 

      <configuration> 
       <executable>java</executable> 

       <arguments> 
        <argument>-Dmyproperty=myvalue</argument> 
        <argument>-classpath</argument> 
        <classpath/> 
        <argument>kilim.tools.Weaver</argument> 
        <argument>-d</argument> 
        <argument>${project.build.outputDirectory}</argument> 
        <argument>${project.build.outputDirectory}/com/contivo/smf</argument> 
       </arguments> 
      </configuration> 
     </plugin> 

에 의해 발생 : 때 java.io.IOException : 때 java.io.IOException : 오류 = 2, 자바에서 해당 파일이나 디렉토리 (디렉토리에 "MY 프로젝트 디렉토리") 프로그램 "자바"를 실행할 수 없습니다 .lang.ProcessBuilder.start (ProcessBuilder.java:460) at java.lang.Runtime.exec (Runtime.java:593) at org.apache.commons.exec.launcher.Java13CommandLauncher.exec (Java13CommandLauncher.java:58)) at org.apache.commons.exec.DefaultExecutor.launch (DefaultExecutor.java:246) at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:302) at org.apache.commons.exec .DefaultExecutor.execute (DefaultExecutor.java:14) 9) org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:589) org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:335) 에서 에서 ... (21)보다

내가 누락 된 구성이 있습니다.

미리 감사드립니다.

사티시.

+1

PATH에 java가 있습니까? –

+0

java가 내 경로에 있음 –

답변

0

실행 가능한 명령 전체 경로 또는 실행 가능한 이름이 될 수 있습니다. 후자의 경우, 실행 파일은 실행을 위해 PATH에 있어야합니다.

플러그인은 다음과 같은 순서로 실행 파일을 검색합니다 : 난 전체 경로로 시도했습니다

relative to the root of the project 
as toolchain executable 
relative to the working directory (Windows only) 
relative to the directories specified in the system property PATH (Windows Only) 

, 그것은 작동합니다.

1

Put it in the PATH - Maven은 java 및 javac이 PATH에 있으면 더 잘 작동합니다.

+0

이 특정 정보에 대해이 작업을 수행하는 방법에 대한 예제가 있습니까? – streetlight