Results 1 to 8 of 8

Thread: How to deploy a war file created in Maven to tc server in STS?

  1. #1
    Join Date
    Jan 2012
    Posts
    11

    Default How to deploy a war file created in Maven to tc server in STS?

    Hello - I've been playing around with some STS sample projects, can can get them working using the included jetty server. I've also been able to import them to STS by using "mvn eclipse:eclipse" and then importing the project. However, I would like to deploy the war file that get created in one of the project to the tc server that comes with STS. How would I go about doing this?

    Thanks!

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,630

    Default

    Simply don't... Simply select Run As -> Server -> Select tc Server or drag the project to the server instance. You don't need to create a war and deploy that.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jan 2012
    Posts
    11

    Default

    Quote Originally Posted by Marten Deinum View Post
    Simply don't... Simply select Run As -> Server -> Select tc Server or drag the project to the server instance. You don't need to create a war and deploy that.
    Unfortunately, the project doesn't have that option, and if I try to drag in onto the server, it just shows the "do not enter" icon. It's the "echo" example from the samples for Spring-ws, so it's a Spring web service.

    I tried turning it into a web project by configuring it as a faceted form and selecting "Dynamic Web Module", but in that case the echo client receives a "404 not found".

    Any other thoughts?

    Thanks for the reply.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,630

    Default

    Is your project a war project (is packaging set to war?) also if you have STS you can simply import the project as maven project and you don't need to do eclipse:eclipse. Also try using the most recent version of the eclipse plugin for maven (2.9 if I'm not mistaken) which might have better WTP support.

    You might also want to try to set the wtpversion property on the plugin to force WTP file generation.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Jan 2012
    Posts
    11

    Default

    Quote Originally Posted by Marten Deinum View Post
    Is your project a war project (is packaging set to war?) also if you have STS you can simply import the project as maven project and you don't need to do eclipse:eclipse. Also try using the most recent version of the eclipse plugin for maven (2.9 if I'm not mistaken) which might have better WTP support.

    You might also want to try to set the wtpversion property on the plugin to force WTP file generation.
    Marten - the packaging is set to war. But, when I try to import it to STS, using file, import, existing project into workspace, and choose the project, it says "no project are found to import" on the dialog box. If I try it with file, new java project, and specify the server folder, it imports but has lots of errors due to the annotation not being found. Is this affected by the WTP version?

    How does one import a maven project into STS?

    Thanks!

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,630

    Default

    It isn't an existing project. You should use Import -> Maven Project..

    Existing projects are existing Eclipse projects not maven projects.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    Jan 2012
    Posts
    11

    Default

    Quote Originally Posted by Marten Deinum View Post
    It isn't an existing project. You should use Import -> Maven Project..

    Existing projects are existing Eclipse projects not maven projects.

    got it - thanks! I still wish I could figure out a way to deploy that war file to the tc server, though. There's got to be a way.

  8. #8
    Join Date
    Dec 2009
    Location
    Pittsburgh, PA
    Posts
    2

    Default

    Try to copy your war into the directory where your server is running. The auto deployment worked for me.

    http://static.springsource.com/proje...cgsdeploy.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •