나는 오래된 웹 애플리케이션 프로젝트를 가졌다. 그런 다음 pom.xml
을 추가하고 maven-war-plugin
을 추가하십시오. 이전 프로젝트 소스는 "Java Resources/src"
디렉토리에있었습니다.maven-war-plugin 소스 디렉토리를 오버라이드하는 방법
내 메이븐 - 전쟁 플러그인에서이 기본 소스 디렉터를 무시하고 있지만 작동하지 않습니다. 컴파일하는 동안
내가 볼 : `
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ webproj ---
[INFO] No sources to compile
[INFO]
`
내 pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webXml>WebContent\WEB-INF\web.xml</webXml>
<webappDirectory>WebContent</webappDirectory>
<source>${project.basedir}\src</source>
<target>${maven.compiler.target}</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
전쟁을 시작하려고 할 때 나를 위해 작동하지 않습니다. 폭발했습니다. 플러그인은 기본 소스 디렉토리에있는 소스를 얻으려고 시도합니다. – herau
당신은'sourceDirectory'를 오버라이드합니다. 이것은'maven-war-plugin' 옵션이 아닌 maven 속성입니다. 플러그인은 더 많은 디렉토리가 필요할 때만 유용합니다. –