Я использую maven-assembly-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
файл сборки:
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>rules</id>
<formats>
<format>jar</format>
</formats>
<baseDirectory>xxx-xxx-xxxFramework-rules</baseDirectory>
<fileSets>
<fileSet>
<outputDirectory></outputDirectory>
<directory>${basedir}</directory>
<excludes>
<exclude>target</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
У меня в каталоге root
есть папка с именем règle
. Я использую mvn clean deploy
. На моем устройстве Windows 10 у меня все нормально с папкой règle
в моем файле jar final, но если я построю на своем Jenkins Unix Docker, у меня будет успешная сборка, но без моей папки с именем règle
в мой файл jar final.
EDIT журналы в Jenkins Docker:
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/share/maven
Java version: 1.8.0_191, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-1127.el7.x86_64", arch: "amd64", family: "unix"
EDIT 2 (добавить -X в команду Maven) :
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-assembly-plugin:2.6:single' with basic configurator -->
[DEBUG] (s) appendAssemblyId = true
[DEBUG] (f) attach = true
[DEBUG] (s) basedir = /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-xxxframework/xxx-xxx-xxxFramework-xxx
[DEBUG] (s) descriptor = assembly.xml
[DEBUG] (f) dryRun = false
[DEBUG] (f) encoding = Cp1252
РЕДАКТИРОВАТЬ 3:
[DEBUG] (f) encoding = UTF-8
[DEBUG] All known ContainerDescriptorHandler components: [file-aggregator, metaInf-spring, plexus, metaInf-services]
[DEBUG] FileSet[] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'
[DEBUG] NOT reformatting any files in /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-xxxframework/xxx-xxx-xxxFramework-rules/.
[DEBUG] Adding file-set in: /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-xxxframework/xxx-xxx-xxxFramework-rules/. to archive location: xxx-xxx-xxxFramework-rules/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/.settings/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/bom/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/ressources/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/ressources/xom-libraries/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/target/
[DEBUG] adding directory xxx-xxx-xxxFramework-rules/target/archive-tmp/
РЕДАКТИРОВАТЬ 4:
Я пытаюсь добавить это, но не делаю этого работа:
<fileMode>0755</fileMode>
<directoryMode>0755</directoryMode>
РЕДАКТИРОВАТЬ 5:
Я добавляю это:
withMaven(globalMavenSettingsConfig: 'empty-global-settings', mavenSettingsConfig: Constants.CONFIG_SETTINGS_ID) {
sh "pwd"
sh "ls -lrt"
sh "ls -lrt /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-commonutility/xxx-xxx-CommonUtility-rules"
sh "ls -lrt /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-commonutility/xxx-xxx-CommonUtility-rules/règles"
sh "$MVN_CMD deploy -X"
}
, и мой результат:
+ ls -lrt /home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-commonutility/xxx-xxx-CommonUtility-rules
total 8
drwxr-xr-x. 2 jenkins root 125 Jul 15 21:32 bom
-rw-r--r--. 1 jenkins root 657 Jul 15 21:32 assembly.xml
drwxr-xr-x. 3 jenkins root 27 Jul 15 21:32 ressources
-rw-r--r--. 1 jenkins root 1492 Jul 15 21:32 pom.xml
drwxr-xr-x. 2 jenkins root 57 Jul 15 21:32 data
drwxr-xr-x. 3 jenkins root 23 Jul 15 21:32 règles
drwxr-xr-x. 3 jenkins root 82 Jul 15 21:32 target
[Pipeline] sh
+ ls -lrt $'/home/jenkins/workspace/xxx_Common_xxxGenerate/xxx-xxx-commonutility/xxx-xxx-CommonUtility-rules/r\303\250gles'
total 0