Pau*_*zie 8 java maven maven-dependency-plugin
我确定这是有效的!
我有一个maven依赖插件配置将java服务包装器放入appassembler目标文件夹中的特定文件夹.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.2.1</version>
<classifier>${target.arch.classifier}</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/appassembler/jsw/projectnamehere/lib</outputDirectory>
<destFileName>wrapper-${target.arch}.dll</destFileName>
</artifactItem>
</artifactItem>
</artifactItems>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但它被写为wrapper.dll(它是repo中的文件名).target.arch设置为"windows-x86-32".
这是日志文件的一部分:
[DEBUG] (s) groupId = org.tanukisoftware
[DEBUG] (s) artifactId = wrapper
[DEBUG] (s) version = 3.2.1
[DEBUG] (s) classifier = win32
[DEBUG] (s) type = jar
[DEBUG] (s) overWrite = true
[DEBUG] (s) outputDirectory = <projectfolder>\target\appassembler\jsw\SophisToTradeCacheConsumer\lib
[DEBUG] (s) destFileName = wrapper-windows-x86-32.dll
...
[DEBUG] (f) outputAbsoluteArtifactFilename = false
[DEBUG] (s) outputDirectory = <projectfolder>\target\dependency
[DEBUG] (s) overWriteIfNewer = true
[DEBUG] (s) overWriteReleases = false
[DEBUG] (s) overWriteSnapshots = false
...
[INFO] [dependency:unpack {execution: default-cli}]
[INFO] Configured Artifact: org.tanukisoftware:wrapper:win32:3.2.1:jar
[INFO] Unpacking C:\WORK\maven\repository\org\tanukisoftware\wrapper\3.2.1\wrapper-3.2.1-win32.jarto
<projectfolder>\target\appassembler\jsw\SophisToTradeCacheConsumer\lib
with Includes null and excludes:null
[DEBUG] Expanding: C:\WORK\maven\repository\org\tanukisoftware\wrapper\3.2.1\wrapper-3.2.1-win32.jar into <projectfolder>\target\appassembler\jsw\SophisToTradeCacheConsumer\lib
[DEBUG] expand complete
Run Code Online (Sandbox Code Playgroud)
我看到你正在使用dependency:unpack,但这个目标(逻辑)不支持destFileName(目标文件名并没有真正意义解压文件时,小号).
在您的情况下,在打包dll时使用"最终名称".或者使用Maven AntRun插件进行一些后期处理以重命名文件.
| 归档时间: |
|
| 查看次数: |
3855 次 |
| 最近记录: |