Quantcast

How to convert or use a Maven project as a dynamic web project?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to convert or use a Maven project as a dynamic web project?

dkarr
I like the ability to integrate with Maven in Eclipse, but I also like
the ability to create "Dynamic Web" projects, which facilitates
deployment to the servers managed by the Eclipse instance.

If I import a Maven project that is a web application, I don't see how
to use it as a dynamic web project.  I might be able to simply create a
new dynamic web project from existing source, but I'm not sure if that
will work.  What is the best way (or any way) to do this?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to convert or use a Maven project as a dynamic web project?

Eugene Kuleshov
David,

  First of all you need to make sure that you have the WTP integration feature installed.
  Please check the WTP howto at http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto

  If you start from the proper Maven war project (i.e. it can be build with "mvn package" command), then should work out of the box (i.e. create war project from Maven archetype as described in WTP howto above, or when importing war project from local disk or version control).

  However if you start from the project created using WTP wizards (e.g. "New dynamic web project"), then you'll need to manually create a pom.xml and make sure that Maven build would produce a correct war for your project. Usually it will require to set the packaging to "war" and the maven-war-plugin with an appropriate configuration to the project's pom.xml. Once that is done, you can use Maven / Enable Dependency management and Maven / Update Project configuration to enable Maven support on that project.

  regards,
  Eugene


David M. Karr wrote
I like the ability to integrate with Maven in Eclipse, but I also like
the ability to create "Dynamic Web" projects, which facilitates
deployment to the servers managed by the Eclipse instance.

If I import a Maven project that is a web application, I don't see how
to use it as a dynamic web project.  I might be able to simply create a
new dynamic web project from existing source, but I'm not sure if that
will work.  What is the best way (or any way) to do this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to convert or use a Maven project as a dynamic web project?

dkarr
Eugene Kuleshov wrote:

> David,
>
>   First of all you need to make sure that you have the WTP integration
> feature installed.
>   Please check the WTP howto at
> http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto
>
>   If you start from the proper Maven war project (i.e. it can be build with
> "mvn package" command), then should work out of the box (i.e. create war
> project from Maven archetype as described in WTP howto above, or when
> importing war project from local disk or version control).
>
>   However if you start from the project created using WTP wizards (e.g. "New
> dynamic web project"), then you'll need to manually create a pom.xml and
> make sure that Maven build would produce a correct war for your project.
> Usually it will require to set the packaging to "war" and the
> maven-war-plugin with an appropriate configuration to the project's pom.xml.
> Once that is done, you can use Maven / Enable Dependency management and
> Maven / Update Project configuration to enable Maven support on that
> project.

I can see that both of these strategies will work.  However, I often
have a situation where I have an existing application that's already
created outside of Eclipse.  When I have this as a starting point, all
the strategies I'm aware of only get me partially there.  If I "Import"
the existing project, it doesn't know it's a web application.  I imagine
this is an issue outside the scope of this plugin.

> David M. Karr wrote:
>> I like the ability to integrate with Maven in Eclipse, but I also like
>> the ability to create "Dynamic Web" projects, which facilitates
>> deployment to the servers managed by the Eclipse instance.
>>
>> If I import a Maven project that is a web application, I don't see how
>> to use it as a dynamic web project.  I might be able to simply create a
>> new dynamic web project from existing source, but I'm not sure if that
>> will work.  What is the best way (or any way) to do this?
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to convert or use a Maven project as a dynamic web project?

Igor Fedorenko-3
David,

If you import existing maven project with packaging=war into m2e as maven
project, you will get dynamic web project, assuming you have m2e WTP
Integration optional feature installed.

--
Regards,
Igor


> Eugene Kuleshov wrote:
>> David,
>>
>>   First of all you need to make sure that you have the WTP integration
>> feature installed.
>>   Please check the WTP howto at
>> http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto
>>
>>   If you start from the proper Maven war project (i.e. it can be build
>> with
>> "mvn package" command), then should work out of the box (i.e. create war
>> project from Maven archetype as described in WTP howto above, or when
>> importing war project from local disk or version control).
>>
>>   However if you start from the project created using WTP wizards (e.g.
>> "New
>> dynamic web project"), then you'll need to manually create a pom.xml and
>> make sure that Maven build would produce a correct war for your project.
>> Usually it will require to set the packaging to "war" and the
>> maven-war-plugin with an appropriate configuration to the project's
>> pom.xml.
>> Once that is done, you can use Maven / Enable Dependency management and
>> Maven / Update Project configuration to enable Maven support on that
>> project.
>
> I can see that both of these strategies will work.  However, I often
> have a situation where I have an existing application that's already
> created outside of Eclipse.  When I have this as a starting point, all
> the strategies I'm aware of only get me partially there.  If I "Import"
> the existing project, it doesn't know it's a web application.  I imagine
> this is an issue outside the scope of this plugin.
>
>> David M. Karr wrote:
>>> I like the ability to integrate with Maven in Eclipse, but I also like
>>> the ability to create "Dynamic Web" projects, which facilitates
>>> deployment to the servers managed by the Eclipse instance.
>>>
>>> If I import a Maven project that is a web application, I don't see how
>>> to use it as a dynamic web project.  I might be able to simply create a
>>> new dynamic web project from existing source, but I'm not sure if that
>>> will work.  What is the best way (or any way) to do this?
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to convert or use a Maven project as a dynamic web project?

Eugene Kuleshov
In reply to this post by dkarr
David M. Karr wrote
>   If you start from the proper Maven war project (i.e. it can be build with
> "mvn package" command), then should work out of the box (i.e. create war
> project from Maven archetype as described in WTP howto above, or when
> importing war project from local disk or version control).
>
>   However if you start from the project created using WTP wizards (e.g. "New
> dynamic web project"), then you'll need to manually create a pom.xml and
> make sure that Maven build would produce a correct war for your project.
> Usually it will require to set the packaging to "war" and the
> maven-war-plugin with an appropriate configuration to the project's pom.xml.
> Once that is done, you can use Maven / Enable Dependency management and
> Maven / Update Project configuration to enable Maven support on that
> project.

I can see that both of these strategies will work.  However, I often
have a situation where I have an existing application that's already
created outside of Eclipse.  When I have this as a starting point, all
the strategies I'm aware of only get me partially there.  If I "Import"
the existing project, it doesn't know it's a web application.  I imagine
this is an issue outside the scope of this plugin.
This is just the second scenario, so you need to create a pom.xml and make your existing project a valid Maven project. After that you can import it as a Maven project into Eclipse.

  regards,
  Eugene

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to convert or use a Maven project as a dynamic web project?

dkarr
In reply to this post by Igor Fedorenko-3
Igor Fedorenko wrote:
> David,
>
> If you import existing maven project with packaging=war into m2e as maven
> project, you will get dynamic web project, assuming you have m2e WTP
> Integration optional feature installed.

Hmm, well, I thought this wasn't working before, but I just tried it
again, and it appeared to work fine.  Thanks.

>
> --
> Regards,
> Igor
>
>
>> Eugene Kuleshov wrote:
>>> David,
>>>
>>>   First of all you need to make sure that you have the WTP integration
>>> feature installed.
>>>   Please check the WTP howto at
>>> http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto
>>>
>>>   If you start from the proper Maven war project (i.e. it can be build
>>> with
>>> "mvn package" command), then should work out of the box (i.e. create war
>>> project from Maven archetype as described in WTP howto above, or when
>>> importing war project from local disk or version control).
>>>
>>>   However if you start from the project created using WTP wizards (e.g.
>>> "New
>>> dynamic web project"), then you'll need to manually create a pom.xml and
>>> make sure that Maven build would produce a correct war for your project.
>>> Usually it will require to set the packaging to "war" and the
>>> maven-war-plugin with an appropriate configuration to the project's
>>> pom.xml.
>>> Once that is done, you can use Maven / Enable Dependency management and
>>> Maven / Update Project configuration to enable Maven support on that
>>> project.
>> I can see that both of these strategies will work.  However, I often
>> have a situation where I have an existing application that's already
>> created outside of Eclipse.  When I have this as a starting point, all
>> the strategies I'm aware of only get me partially there.  If I "Import"
>> the existing project, it doesn't know it's a web application.  I imagine
>> this is an issue outside the scope of this plugin.
>>
>>> David M. Karr wrote:
>>>> I like the ability to integrate with Maven in Eclipse, but I also like
>>>> the ability to create "Dynamic Web" projects, which facilitates
>>>> deployment to the servers managed by the Eclipse instance.
>>>>
>>>> If I import a Maven project that is a web application, I don't see how
>>>> to use it as a dynamic web project.  I might be able to simply create a
>>>> new dynamic web project from existing source, but I'm not sure if that
>>>> will work.  What is the best way (or any way) to do this?
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...