Error “The goal you specified requires a project to execute but there is no POM in this directory” after executing maven command

后端 未结 15 1280
南笙
南笙 2020-12-02 11:29

I have a pom.xml in C:\\Users\\AArmijos\\Desktop\\Factura Electronica\\MIyT\\componentes-1.0.4\\sources\\pom.xml and I executed:

mv         


        
相关标签:
15条回答
  • 2020-12-02 12:18

    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.

    0 讨论(0)
  • 2020-12-02 12:18

    On Windows, I got this error when running under a non-administrator command prompt. When I ran this as administrator, the error went away.

    0 讨论(0)
  • 2020-12-02 12:19

    Please run it from the directory where POM.XML resides.

    0 讨论(0)
  • 2020-12-02 12:26

    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

    0 讨论(0)
  • 2020-12-02 12:27

    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 
    
    0 讨论(0)
  • 2020-12-02 12:30

    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
                }
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题