I have a maven project and I am able to build locally the .war
file.
When I am trying to achieve using jenkins it is getting failed with error as Unmappable character for endcoing ASCII
Step 1 : In Jenkins -> Selected -> pipeline script
Step 2 : In my setting.xml
file ->
I mentioned the artifactory username
and password
.
At time of building maven it downloads few artifacts at runtime from artifatory (Jfrog
)
Step 3 : My setting.xml
file
<?xml version="1.0" encoding="UTF-8"?>
<setting xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLcoation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<username> abc </username>
<password> XXXXXX </password>
<id>snapshotdemo</id>
</server>
</servers>
<profiles>
<profile>
<id> artifactory-demo </id>
<repositores>
<repository>
<snapshots/>
<id>snapshotdemo</id>
<name>maven-demo</name>
<url> https://artifactory.com:8080/artifactory/demo-maven</url>
</repository>
</repositores>
<pluginRepositories>
<pluginRepository>
<snapshots/>
<id>snapshotdemo</id>
<name>maven-demo</name>
<url> https://artifactory.com:8080/artifactory/demo-maven</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile> artifactory-demo </activeProfile>
</activeProfiles>
</settings>
Step 4 : Not providing the pom.xml
file details due to confidential reason. Let me know what part is needed will try to add only specific details.
Step 5 : Below is My pipeline script
pipeline
{
agent
{
node {
label 'Demo-maven'
}
}
stages {
stage {
steps {
git (url : 'ssh//[email protected]:8080/demo/redis.git' , credentials : 'DEMO_BITBUCKET' )
}
}
stage('Maven Build 0')
{
steps
{
sh 'mvn clean install -f ./redis/pom.xml -s ./redis/setting.xml'
}
}
}