내가 아는 한, Maven은 수정 된 파일 만 컴파일하고 대상 폴더에 복사한다.maven 빌드에 너무 많은 시간이 걸린다
내 webapp 폴더에는 800MB 크기의 파일이 많이 있습니다.
이 명령을 실행할 때 (mvn 패키지).
이 대상으로하는 모든 리소스를 복사 이상 십분 소요/icall/
[INFO] 복사 웹 애플리케이션 리소스 [/ DATA1/공간/icall/SRC/주/웹 애플리케이션]
이것은 나를 짜증나게합니다.
수정 된 파일 또는 새로 생성 된 파일 만 복사 할 수있는 방법이 있습니까 ??
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.byto</groupId>
<artifactId>icall</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>icall Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>icall</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<escapeString>\</escapeString>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<wtpversion>1.5</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- Unrelated Profiles -->
</profiles>
<properties>
<spring-version>3.1.1.RELEASE</spring-version>
<tiles-version>2.2.2</tiles-version>
<mybatis-version>3.1.1</mybatis-version>
</properties>
<dependencies>
<!-- Lots of Unrelated Dependencies -->
</dependencies>
</project>
는 여기에 내가 패키지 대신 사용하거나 목표를 설치 리눅스 bash는 파일입니다. 하지만 필자는 메이븐의 주요 특징 인 의존성 관리를 사용할 수 없다. 그러나 이것은 여전히 나에게 좋다.
#! /bin/sh
tomcat_path=/usr/local/tomcat
source_path=/data1/workspace/icall
deploy_path=/data1/icall_root
function refresh_source {
# Update source from SVN
echo -e "\n\n** Getting new sources from SVN." &&
svn update &&
# Compile *.java
echo -e "\n\n** Building *.java with Maven." &&
mvn compile -Pdev &&
# Copy only modified files
echo -e "\n\n** copying files from ${source_path}/src/main/webapp to ${deploy_path}." &&
rsync -av --exclude=.svn --exclude=WEB-INF/lib/* --exclude=WEB-INF/classes/* --delete ${source_path}/src/main/webapp/* ${deploy_path}/ &&
echo -e "\n\n** copying files from ${source_path}/library to ${deploy_path}/WEB-INF/lib." &&
rsync -av --delete --delete-excluded ${source_path}/library/* ${deploy_path}/WEB-INF/lib/ &&
echo -e "\n\n** copying files from ${source_path}/target/classes/ to ${deploy_path}/WEB-INF/classes/"
rsync -av --checksum --delete --delete-excluded ${source_path}/target/classes/* ${deploy_path}/WEB-INF/classes/ &&
## Only for development server
cp -f ${deploy_path}/info.jsp ${deploy_path}/data/info.jsp
}
function tomcat_restart {
${tomcat_path}/bin/shutdown.sh &&
sleep 30 &&
${tomcat_path}/bin/startup.sh
}
case "$1" in
restart)
refresh_source &&
tomcat_restart
;;
log)
tail -f ${tomcat_path}/logs/catalina.out
;;
*)
refresh_source
;;
esac
src/main/webapp에있는 자원은 src/main/resources에없는 이유는 무엇입니까? 또한 target/icall 폴더가 비정상적으로 보입니까? – khmarbaise
당신을 도울 수 있도록 귀하의 포를 게시 할 수 있습니까? –
참조 용 Pom.xml 파일을 참조하십시오. 고맙습니다. –