Announcement Announcement Module
Collapse
No announcement yet.
problem with deploying my app. (based on maven) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with deploying my app. (based on maven)

    Hi,
    first I should apologize because of posting this topic here, because it's not exactly a spring issue, sorry friends ....
    Problem : I created a maven-based web application (based on spring mvc ofcourse), and the problem is that when I use the command : $mvn clean compile install (or simply mvn install) to deploy my app, there is no .class files in target/classes directory, & thus, the app. fails on execution. I should note that I see .java files there, instead of .class files. This force me to manually rebuild my maven-based project via IDE

    I tried to google it, but don't found anything relating to this issue.

    So, my question is this : how to use maven to correcly deploy my project (with compiled classes in /target/classes instead of .java files !!!)

    thanx

  • #2
    any opinions ?

    Comment


    • #3
      Can you tell us your directory structure in your project? Maven has strong conventions about this.

      Comment


      • #4
        And did you create your project by maven command? What command did you involve?

        Comment


        • #5
          Hello sja, ...
          I really appreciate your help sir, thanx for your attention & your useful tip
          yeah ! you were correct !!! My java codes has been placed on "resources" folder and I was wondering about the result !!!

          so , for those who will have the same problem in the future and may see this page with the help of seach :

          my previous project structure was something like this : (I ommited unnecessary info) :
          Code:
          prj-dir
          	pom.xml
          	deploy.sh
          	index.jsp
          	src/
          		main/
          			resources/
          				app/
          					dao/
          					entity/
          					handler/
          					ui/
          						Panel.java
          						other java controllers ...
          					util/
          					other packs ...
                                           lang/
          				other project packs ...
          			webapp/
          				index.jsp
          				style/
          				WEB-INF/
          					dispatcher-servlet.xml
          					web.xml
          					jsp/
          						jsp files here ...
          and the correct structure is :
          Code:
          prj-dir
          	pom.xml
          	deploy.sh
          	index.jsp
          	src/
          		main/
          			java/
          				app/
          					dao/
          					entity/
          					handler/
          					ui/
          						Panel.java
          						other java controllers ...
          					util/
          					other packs ...
          				other project packs ...
          			resources/
          				lang/
          				
          			webapp/
          				index.jsp
          				style/
          				WEB-INF/
          					dispatcher-servlet.xml
          					web.xml
          					jsp/
          						jsp files here ...
          and also , remember to put the following in your pom.xml - build - plugins - inorder to use "$mvn install" correctly
          Code:
           <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-compiler-plugin</artifactId>
                          <configuration>
                             <source>1.6</source>
                             <target>1.6</target>
                          </configuration>
                      </plugin>
          again, I appreciate your help sir,
          best regards
          Last edited by nima; Jul 22nd, 2009, 09:29 AM.

          Comment


          • #6
            Originally posted by ctapobep View Post
            And did you create your project by maven command? What command did you involve?
            sir, I just saw your post. as you see in my previous post , I'd made a 'dumb mistake' on my project's structure ... but anyway , I used the following command inorder to create a web-based maven project :
            Code:
            mvn archetype:generate -DgroupId=prjGroupId -DartifactId=prjArtifactId -DarchetypeArtifactId=maven-archetype-webapp
            thanks for you reply too

            Comment

            Working...
            X