Hi all, I am newbie to Struts 2 and Maven tool. I just finished the book "Head First - JSP and Servlet". The book said a little bit about Struts at the last chapter. So I tried to figure out how to work with Struts 2.
I googled online and found out many Struts tutorials ask users to build the project with Maven. I found two tutorials from Apache Struts site and Mkyong, both of them ask for Maven.
However, I get lost after starting with Maven. Here is what I did (learned it from Mkyong):
Finally, I used "import the existing project" option to import it to Eclipse. However, after I imported the project, I checked the "Deployment Assembly" option in project properties, it showed me something like:
In fact, I did see the Maven downloaded these .jar files. They are in the maven local repo directory instead of this "c:/Users/xxx/.m2/...." .
How can I fix this? Is it that I need to manually add these jar files to project from maven local repo directory? I thought Maven should import them automatically. Is it correct?
Dian D Chen wrote:Thank you so much! It works now~
BTW, when I read the tutorial from Apache Maven, it mentioned about setting M2 sys variable. Is that M2 same as this ".m2"?
M2 (M2_HOME) is the system variable that would point to the .m2 directory on disk. It similar to how the JAVA_HOME points to the Java home directory or CLASSPATH points to classes that should be included when java is invoked from the command prompt. Similarly M2_HOME gets used when Maven commands are run from the classpath