Trong dự án Khatami của tôi, tôi đang sử dụng maven để quản lý tổng hợp và đóng gói kết quả thành một tạo phẩm có thể chạy được: thực thi shell-script ở mức cao nhất, bin/
. lọ và lọ phụ thuộc của nó. Vui lòng xem ý tôi là gì here.maven-assembly-plugin MojoExecutionException với dependencySet là outputDirectory
Để tham khảo, đây là một phần nổi bật của pom.xml
Khatami của:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/src.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>${project.groupId}.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
và toàn bộ src/main/assembly/src.xml
:
<assembly>
<id>dist</id>
<formats>
<format>tar.gz</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory>bin</outputDirectory>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>khatami</include>
</includes>
<fileMode>744</fileMode>
<lineEnding>unix</lineEnding>
<filtered>true</filtered>
</fileSet>
</fileSets>
</assembly>
và biên soạn nỗ lực:
$ mvn clean compile assembly:single
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building khatami 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ khatami ---
[INFO] Deleting /home/blt/projects/com/carepilot/repos/khatami/target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ khatami ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/blt/projects/com/carepilot/repos/khatami/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ khatami ---
[INFO] Compiling 1 source file to /home/blt/projects/com/carepilot/repos/khatami/target/classes
[INFO]
[INFO] --- maven-assembly-plugin:2.2-beta-5:single (default-cli) @ khatami ---
[INFO] Reading assembly descriptor: src/main/assembly/src.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.721s
[INFO] Finished at: Mon Jul 18 13:58:30 EDT 2011
[INFO] Final Memory: 8M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project khatami: Failed to create assembly: Error adding file 'com.carepilot.khatami:khatami:jar:1.0-SNAPSHOT' to archive: /home/blt/projects/com/carepilot/repos/khatami/target/classes isn't a file. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Tôi đang ở đâu có lỗi ?
Bạn đang chạy công trình xây dựng maven của mình như thế nào? Từ dòng lệnh hoặc từ bên trong một IDE> –
Dòng lệnh. Danh sách mã cuối cùng chứa dòng có liên quan, bắt đầu bằng '' $ ''. – troutwine
Bạn đã bao giờ sử dụng dự án này với nhật thực và sử dụng một số trình cắm thêm để nhập nó vào môi trường nhật thực. Điều này trông giống như một số vấn đề cấu hình maven.Tôi đã có loại vấn đề và tôi theo dõi nó vào plugin m2eclipse của tôi. (mà s ** ks .. nhân tiện) –