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

后端 未结 15 1279
南笙
南笙 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:31

    There may be a problem with Maven path configuration, if you used unix-like Operator System.

    step 1: create new file in path ~/.bash_profile

    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
    CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    PATH=$JAVA_HOME/bin:$PATH:
    export JAVA_HOME
    export CLASSPATH
    export PATH
    

    step 2: shell run source ~/.bash_profile OR modify zsh config file(add new line: source ~/.bash_profile)

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

    This link helped: https://stackoverflow.com/a/11199865/1307104

    I edit my command by adding quotes for every parameter like this:

    mvn install:install-file "-DgroupId=org.mozilla" "-DartifactId=jss" "-Dversion=4.2.5" "-Dpackaging=jar" "-Dfile=C:\Users\AArmijos\workspace\componentes-1.0.4\deps\jss-4.2.5.jar"

    It's worked.

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

    On windows as far as I'm concerned you have to enclose all parameters with quotes.

    So if you want to create a maven webapp archetype you would do as follows:

    Prerequisites:

    1. Make sure you have maven installed and have it in your PATH environment variable.

    Howto:

    1. Open windows powershell
    2. mkdir MyWebApp
    3. cd MyWebApp
    4. mvn archetype:generate "-DgroupId=com.javan.dev" "-DartifactId=MyWebApp" "-DarchetypeArtifactId=maven-archetype-webapp" "-DinteractiveMode=false"

    Note: This is tested only on windows 10 powershell

    0 讨论(0)
提交回复
热议问题