maven-archetype-webapp eclipse problem

后端 未结 17 1642
囚心锁ツ
囚心锁ツ 2020-11-29 20:49

I\'m trying to create a very simple webapp with maven and eclipse, but I\'m having no joy at all, in fact the reverse of joy.

I go to File -> New Project, select Mav

相关标签:
17条回答
  • 2020-11-29 21:33

    Simply create a java directory under main (i.e. src/main/java) and right-click on your project and select Maven > Update Project Configuration.

    0 讨论(0)
  • 2020-11-29 21:33

    for src/main/java your project >> properties >> java build path >> source >>
    search "Your Project src/main/java (missin)" >>>

    edit > folder name >> next >> Inclusion patterns: -----> Add >> src/main/java OK

    and if errors still don't disapear

    >>>  look in Target Runtimes  and check your apache in checkbox
    
    0 讨论(0)
  • 2020-11-29 21:37

    Following steps work in eclipse 2020-06

    1. File->New->Maven Project
    2. Choose "Create a simple project (skip archetype selection)"
    3. Choose packaging as "war" (this will create both webapp and java folders)
    4. Create the project after specifying group id and artifact id
    5. Update pom.xml with java and compiler versions, then right click on project, select Maven->Update project
    6. If the project is not faceted form (Its not in faceted form if on expanding project in Project explorer, it doesn't show details such as "Deployment Descriptor" and "JAX-WS Web Services", this happened in one of my eclipse installation and i had no clue why), then do the following steps
      1. right click on project, go to Properties, click on Project Facets, convert to faceted form, choose correct "Dynamic Web Module" version, enable the checkbox and also choose correct Java Facet version.
      2. "Further configuration available" gets displayed in that window, click on it and specify WebContent folder. (replace WebContent by src/main/webapp)
      3. If you want to run the application in servers configured in eclipse, then specify maven dependencies to be deployed in "Deployment Assembly". This will deploy maven "provided" dependencies also, but i think its fine for testing. For actual distribution, you can supply war file generated from maven package.
    0 讨论(0)
  • 2020-11-29 21:38

    There is an option to create a source directory in eclipse. Or you can go to build path under project properties, and add an existing directory as a source directory.

    If you are going to use non-standard directory structure you will have to specify it in maven though

    0 讨论(0)
  • 2020-11-29 21:40

    in IntelliJ IDEA 13 you must first create "java" folder in main folder then --> go to "open module setting"- for this you can click on project name and press f4- , and set label of "java" folder to "source" .

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