"Maven issues" summary of various issues encountered in applying MAVEN build projects

Source: Internet
Author: User

1. Define archetype build a custom Maven project


    • Reference Document : Create a custom archetype using Maven3.
    • resolution Process
      I based on the above process, in the "mvn archetype:create-from-project" times wrong, the error content is as follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:create-from-project (DEFAULT-CLI) on
Project Shiro_learn2:error Configuring command-line. Reason:maven executable not found At:d:\hwprogramfiles\maven\apa
Che-maven-3.3.3\bin\mvn.bat, [Help 1]
[ERROR]
[ERROR] The full stack trace of the errors, re-run Maven with THE-E switch.
[ERROR] Re-run Maven using The-x switch to enable full debug logging.
[ERROR]
[ERROR] For more information on the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

2. Add maven to configure the local repository

Configuration : windows–>preferences–>maven–>usersetting
reference Documentation :

    • Reference Document 1:maven Local warehouse configuration
    • Reference Document 2: Modify the MAVEN local warehouse path.
3. Create a new MAVEN project that does not show the source file package
    • Symptom : Eclipse creates a MAEVN Web project, and after selecting the Maven_archetype_web prototype, the default is only src/main/resources this source Floder
    • workaround : Right-select Properties on the project and click Java Build Path, under Librarys, edit JRE System Library, select workspace Default JRE.
    • Reference Document : Resolving the Src/main/java Resource folder cannot be established after Eclipse builds a MAVEN project
4. Maven Display Red Fork, Pom.xml file without error, problems display: Maven missing artifact
    • problem : The corresponding jar package file is not found in the warehouse
    • workaround : You can configure multiple warehouses, remote and local, (can refer to other blog content)
    • Reference Document 1: Addressing maven's "Missing artifact ..." problem
5. Workarounds for Artifactdescriptorexception in maven
  • The cause of this problem : The following is introduced in Pom.xml in the MAVEN project:

        <dependency ;  <groupid ;  Org.forgerock.openam    </groupid ;  <artifactid ;  openam-oauth2    </artifactid ;  <version ;  ${openam.version} </version ;  </dependency ;   
  • problem Solving : seems to be unable to parse ${openam.version} , change it to 12.0.0 on it, MAVEN does not support ${openam.version} this writing? But I was directly clone in GitHub (it seems that Maven has to study well.)
  • Reference Document : Artifactdescriptorexception's workaround
6. Maven-web Project Error: Project configuration is not up-to-date with pom.xml. Run maven->update Project or use Quick Fix
    • Reference Documentation: Project configuration is not a up-to-date with pom.xml. Run maven->update Project or use Quick Fix
7.★★maven Project: Problems report the following error, and the Package Explorer View Project icon has a small red fork, but the project file does not show the Red Fork
    • error prompt

      1. error 1 : Description Resource Path location Type cannot c Hange version of Project facet Dynamic Web Module to 3.0. SHIRO_LEARN1 Line 1 Maven Java EE Configuration problem
      2. error 2 : Description Resource Path locatio n Type one or more constraints has not been satisfied. SHIRO_LEARN1 Line 1 Maven Java EE Configuration problem
    • workaround
      First step: Refer to the reference document below Make changes to related documents in your project
      Step two: ★ Right-click Project > Maven > Update Project Configuration. OK perfect solution

    • reference Documentation:
      Reference Document 1:cannot change version of project facet Dynamic Web
      Reference Document 2: Resolve Cann OT change version of the project Facet Dynamic Web module to 2.5
    • question
      Refer to document 1 and Reference document 22 documents that say something a little different. That is: Org.eclipse.wst.common.component file "project-version" whether to change, temporarily no system to learn maven, so this problem can only be placed here temporarily, if there is understanding of the specific meaning, convenient words to inform.
8.★★maven Project Right-click into maven > Project Facets > Dynamic WEB Module to 3.0 error: Cannot change version of project Facet Dynamic W EB module to 3.0
    • Solution:
      Introduce a local jar package or install a local jar package to the local repository in the MAVEN project. Introduce a local jar package: Assuming that the Ikanalyzer3.2.8.jar package is introduced under local C:\Users\yangping\Desktop\a\, the configuration dependency in Pom.xml is as follows:
< Dependency ;  <groupid ;  Org.wltea</groupid ;   <artifactid ;  ikanalyzer</ artifactid ;  <versi on ;  3.2.8</version ;  <systempath ;  C:\Users\yangping\Desktop\a\ Ikanalyzer3.2.8.jar</systempath ;  </dependency ;   
    • Reference Document : Resolve cannot change version of Project facet Dynamic Web module to 2.5
9. Install the local jar package to the local warehouse

First step: Copy the jar package that will be installed to the repository and create the Hw-openam-restlet-extension-0.0.1.pom in that directory

<?xml version= "1.0" encoding= "UTF-8"?><projectxsi:schemalocation= "http://maven.apache.org/POM/4.0.0http:/ /maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="/http// maven.apache.org/pom/4.0.0 "xmlns:xsi=" Http://www.w3.org/2001/XMLSchema-instance " >        <modelversion>4.0.0</modelversion>    <groupId>Openam</groupId>    <artifactid>Hw-openam-restlet-extension</artifactid>    <version>0.0.1</version>    <description>Hw Local Openam Repository</Description></Project>

Second step: open cmd, go to the F:\bx_maven2.m2\repository\com\myxmlbean\customerXmlBean\2.6.0 folder, run the following command command:
mvn install:install-file -Dfile=chw-openam-restlet-extension-0.0.1.jar -DgroupId=openam -DartifactId=hw-openam-restlet-extension -Dversion=0.0.1 -Dpackaging=jar

Reference Document : http://m.blog.csdn.net/blog/lock0531/25891159

Maven Project: non-resolvable parent Pom:failure to find
    • Solution: The next level of the element should be added to specify the correct parent pom path, which defaults to. /pom.xml
    • Reference Documentation: Maven:non-resolvable Parent Pom:failure to find error

"Maven issues" summary of various issues encountered in applying MAVEN build projects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.