I have a pom.xml
in C:\\Users\\AArmijos\\Desktop\\Factura Electronica\\MIyT\\componentes-1.0.4\\sources\\pom.xml
and I executed:
mv
For any of those who are experiencing this on Windows and none of the above worked, try running this from cmd.exe. Executing these commands via PowerShell caused the install to fail each time.
On Windows, I got this error when running under a non-administrator command prompt. When I ran this as administrator, the error went away.
Please run it from the directory where POM.XML resides.
Check for the name of the file, i.e pom.xml file is spelled correctly with proper file extension .xml.
Example for this error are
pom.ml pm.xl
1.create a lib folder in your project file,
2.copy your jarFiles to the lib folder
3.right click on to your jarFile go to build path>Add to build path (now your jar file is part of your refrerenced libraries )
4.open command prompt and navigate to your project directory and write
mvn install: install-file "-Dfile=<yourJarFileName>.jar" "-DgroupId=<yourGroupID>" "-DartifactId=<yourArtifactId>" "-Dversion=<yourVersion>" "-Dpackaging=jar"
6.Rebuild your local repository index by opening in eclipse- go to window>show view>other>maven>maven Repositories. Right click on local Repositores and hit "RebuildIndex"
5.open your pom.xml file and add your dependency
<dependency>
<groupId><yourGroupID></groupId>
<artifactId><yourArtifactId></artifactId>
<version><yourVersion></version>
</dependency>
and run
mvn clean
mvn compile
mvn test
Add the Jenkinsfile where the pom.xml file has present. Provide the directory path on dir('project-dir'),
Ex:
node {
withMaven(maven:'maven') {
stage('Checkout') {
git url: 'http://xxxxxxx/gitlab/root/XXX.git', credentialsId: 'xxxxx', branch: 'xxx'
}
stage('Build') {
**dir('project-dir') {**
sh 'mvn clean install'
def pom = readMavenPom file:'pom.xml'
print pom.version
env.version = pom.version
}
}
}
}