jquery-ui を webapp にダウンロードしました。これには、build.xml
圧縮と縮小の機能があります。build.xml
今、私の中からこれを実行したいと思いますpom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<configuration>
<target>
<ant antfile="src/main/webapp/resources/js/jquery-ui/build/build.xml" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
しかし今、s buildfile is wrong. It creates a dist folder on the wrong place. Here's the
jquery-ui からのこの build.xml` の動作: https://github.com/jquery/jquery-ui/blob/master/build/build.xml
pom.xml と同じ場所 (私が実行する場所と同じ場所mvn clean package
) に dist フォルダーを作成し、その場所に作成する必要があります。src/main/webapp/resources/js/jquery-ui/build
build.xml
指定したディレクトリ(作業ディレクトリ)から実行することはできますか? Ant タスクのドキュメントにアクセスできない: http://ant.apache.org/manual/CoreTasks/ant.html
編集: pom.xml
<?xml version="1.0" encoding="utf-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.myproject</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>myproject</name>
<dependencies>
<!-- ... -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- ... -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>myproject</warName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<executable>make</executable>
<workingDirectory>src/main/webapp/resources/js/jquery</workingDirectory>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<target>
<ant antfile="build.xml" dir="src/main/webapp/resources/js/jquery-ui/build" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
実行mvn clean package
すると、jquery-ui の build.xml の縮小ターゲットで次のエラーが発生します。
[apply] build/minify-js.sh: Line 3: /home/danny/myproject/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js: File or directory not found
正しいパスは、上記の代わりに ${basedir}/src/main/webapp/resources/js/jquery-ui/build/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js である必要があります言及された...