m2eclipse does not recognize web projects

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

m2eclipse does not recognize web projects

jid1jid1
Hi,

I have a web maven project. After I check-it out from scm (svn)
import->check out maven projects from SCP
Eclipse does not recognize it as a web project (can not add it in local server).

I have installed WTP, m2eclipse and m2eclipse extras. This is a clean installation of eclipse-jee-galileo-SR2-win32.

Any idea what I am missing? (It used to work fine with older eclipse and m2eclipse)

Thanks in advance,

 Find a dump of the plugins I have installed:

  AspectJ Development Tools (AJDT) 1.5.3.200807141310 org.eclipse.ajdt.feature.group
    Eclipse AspectJ Development Tools Source Code 1.5.3.200807141310 org.eclipse.ajdt.source.feature.group
  CollabNet Merge Client 2.0.1 com.collabnet.subversion.merge.feature.feature.group
  Eclipse IDE for Java EE Developers 1.2.2.20100217-2310 epp.package.jee
    Eclipse Platform 3.5.2.M20100211-1343 org.eclipse.platform.ide
    Java EE IDE Feature 1.2.2.20100217-2310 org.eclipse.epp.package.jee.feature.feature.group
  JNA Library 3.2.3 com.sun.jna.feature.group
  M2Eclipse Extensions Development Support (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.sdk.feature.feature.group
  Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 org.maven.ide.eclipse.feature.feature.group
    Eclipse Java Development Tools 3.5.2.r352_v20100108-7r88FEwFI0WTuoBl0iaG0tyhfZH6 org.eclipse.jdt.feature.group
    Eclipse Platform 3.5.2.R35x_v20100210-0800-9hEiFzmFst-TiEn9hNYgDWg1XN8ulH_JvCNGB org.eclipse.platform.feature.group
      Eclipse Help System 1.1.2.R35x_v20100119-7e7eFAnFEx2X_fZltJhDjz-D org.eclipse.help.feature.group
      Equinox p2 Provisioning 1.1.2.R35x_v20091106-7u6FbQFUAtsCKD5Fxz0qz0fb2932 org.eclipse.equinox.p2.user.ui.feature.group
    Eclipse RCP 3.5.2.R35x_v20100119-9SA0FxwFnoCU5XxWItFdXXb27BA6 org.eclipse.rcp.feature.group
  Maven Integration for WTP (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.wtp.feature.feature.group
  Maven issue tracking configurator for Mylyn 3.x (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.mylyn3.feature.feature.group
  Maven SCM handler for Subclipse (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.subclipse.feature.feature.group
  Maven SCM handler for Team/CVS (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.cvs.feature.feature.group
  Maven SCM Integration (Optional) 0.10.0.20100209-0800 org.maven.ide.eclipse.scm.feature.feature.group
  Project configurators for commonly used maven plugins (temporary) 0.10.0.20100209-0800 org.maven.ide.eclipse.temporary.mojos.feature.feature.group
  Subclipse (Required) 1.6.10 org.tigris.subversion.subclipse.feature.group
  Subclipse Integration for Mylyn 3.x (Optional) 3.0.0 org.tigris.subversion.subclipse.mylyn.feature.group
  Subversion Client Adapter (Required) 1.6.10 org.tigris.subversion.clientadapter.feature.feature.group
  Subversion JavaHL Native Library Adapter (Required) 1.6.9.3 org.tigris.subversion.clientadapter.javahl.feature.feature.group
  Subversion Revision Graph 1.0.7 org.tigris.subversion.subclipse.graph.feature.feature.group
  Subversive SVN Connectors 2.2.1.I20091009-1900 org.polarion.eclipse.team.svn.connector.feature.group
    Subversive SVN Team Provider (Incubation) 0.7.8.I20091023-1300 org.eclipse.team.svn.feature.group
  SVNKit 1.3.0 Implementation (Optional) 2.2.1.I20091009-1900 org.polarion.eclipse.team.svn.connector.svnkit16.feature.group
  SVNKit Client Adapter (Not required) 1.6.10 org.tigris.subversion.clientadapter.svnkit.feature.feature.group
  SVNKit Library 1.3.2.6267 org.tmatesoft.svnkit.feature.group+
Reply | Threaded
Open this post in threaded view
|

RE: m2eclipse does not recognize web projects

Cocula Remi

It works fine for me.

Is your project Artifact packaging declared as war in pom.xml ?
 

-----Message d'origine-----
De : jid1jid1 [mailto:[hidden email]]
Envoyé : mercredi 9 juin 2010 16:47
À : [hidden email]
Objet : [m2eclipse-user] m2eclipse does not recognize web projects


Hi,

I have a web maven project. After I check-it out from scm (svn)
import->check out maven projects from SCP
Eclipse does not recognize it as a web project (can not add it in local server).

I have installed WTP, m2eclipse and m2eclipse extras. This is a clean installation of eclipse-jee-galileo-SR2-win32.

Any idea what I am missing? (It used to work fine with older eclipse and
m2eclipse)

Thanks in advance,

 Find a dump of the plugins I have installed:

  AspectJ Development Tools (AJDT) 1.5.3.200807141310
org.eclipse.ajdt.feature.group
    Eclipse AspectJ Development Tools Source Code 1.5.3.200807141310
org.eclipse.ajdt.source.feature.group
  CollabNet Merge Client 2.0.1
com.collabnet.subversion.merge.feature.feature.group
  Eclipse IDE for Java EE Developers 1.2.2.20100217-2310 epp.package.jee
    Eclipse Platform 3.5.2.M20100211-1343 org.eclipse.platform.ide
    Java EE IDE Feature 1.2.2.20100217-2310
org.eclipse.epp.package.jee.feature.feature.group
  JNA Library 3.2.3 com.sun.jna.feature.group
  M2Eclipse Extensions Development Support (Optional) 0.10.0.20100209-0800
org.maven.ide.eclipse.sdk.feature.feature.group
  Maven Integration for Eclipse (Required) 0.10.0.20100209-0800
org.maven.ide.eclipse.feature.feature.group
    Eclipse Java Development Tools
3.5.2.r352_v20100108-7r88FEwFI0WTuoBl0iaG0tyhfZH6
org.eclipse.jdt.feature.group
    Eclipse Platform
3.5.2.R35x_v20100210-0800-9hEiFzmFst-TiEn9hNYgDWg1XN8ulH_JvCNGB
org.eclipse.platform.feature.group
      Eclipse Help System 1.1.2.R35x_v20100119-7e7eFAnFEx2X_fZltJhDjz-D
org.eclipse.help.feature.group
      Equinox p2 Provisioning
1.1.2.R35x_v20091106-7u6FbQFUAtsCKD5Fxz0qz0fb2932
org.eclipse.equinox.p2.user.ui.feature.group
    Eclipse RCP 3.5.2.R35x_v20100119-9SA0FxwFnoCU5XxWItFdXXb27BA6
org.eclipse.rcp.feature.group
  Maven Integration for WTP (Optional) 0.10.0.20100209-0800
org.maven.ide.eclipse.wtp.feature.feature.group
  Maven issue tracking configurator for Mylyn 3.x (Optional)
0.10.0.20100209-0800 org.maven.ide.eclipse.mylyn3.feature.feature.group
  Maven SCM handler for Subclipse (Optional) 0.10.0.20100209-0800
org.maven.ide.eclipse.subclipse.feature.feature.group
  Maven SCM handler for Team/CVS (Optional) 0.10.0.20100209-0800
org.maven.ide.eclipse.cvs.feature.feature.group
  Maven SCM Integration (Optional) 0.10.0.20100209-0800
org.maven.ide.eclipse.scm.feature.feature.group
  Project configurators for commonly used maven plugins (temporary) 0.10.0.20100209-0800 org.maven.ide.eclipse.temporary.mojos.feature.feature.group
  Subclipse (Required) 1.6.10 org.tigris.subversion.subclipse.feature.group
  Subclipse Integration for Mylyn 3.x (Optional) 3.0.0
org.tigris.subversion.subclipse.mylyn.feature.group
  Subversion Client Adapter (Required) 1.6.10
org.tigris.subversion.clientadapter.feature.feature.group
  Subversion JavaHL Native Library Adapter (Required) 1.6.9.3
org.tigris.subversion.clientadapter.javahl.feature.feature.group
  Subversion Revision Graph 1.0.7
org.tigris.subversion.subclipse.graph.feature.feature.group
  Subversive SVN Connectors 2.2.1.I20091009-1900
org.polarion.eclipse.team.svn.connector.feature.group
    Subversive SVN Team Provider (Incubation) 0.7.8.I20091023-1300
org.eclipse.team.svn.feature.group
  SVNKit 1.3.0 Implementation (Optional) 2.2.1.I20091009-1900
org.polarion.eclipse.team.svn.connector.svnkit16.feature.group
  SVNKit Client Adapter (Not required) 1.6.10
org.tigris.subversion.clientadapter.svnkit.feature.feature.group
  SVNKit Library 1.3.2.6267 org.tmatesoft.svnkit.feature.group+
--
View this message in context: http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28831380.html
Sent from the Maven Eclipse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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
|

RE: m2eclipse does not recognize web projects

jid1jid1
Thanks for the reply.
No it is assembled using the assembly plugin. It is declared as a jar in the pom (so that depending projects can use deps)

Cocula Remi wrote
It works fine for me.

Is your project Artifact packaging declared as war in pom.xml ?
 

Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

jid1jid1
In reply to this post by jid1jid1
BTW, I tried declaring as war and it is working. Is there a workaround (not by declaring it as war) ?


Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

Tim Schwenk
Boy, I really doubt it.  The whole idea of m2eclipse is that the POM becomes the authoritative source of configuration for your project.  In other words, if your artifact declares itself to be a war, then the m2eclipse WTP integration can set up Eclipse accordingly - i.e. apply the appropriate facets and such.  If it declares itself to be a jar, then how is m2eclipse supposed to know that it's *really* a war masquerading as a jar?

Which raises the question: why on earth are you declaring the packaging to be jar and then turning around and creating a war with the assembly plugin?  That kind of defeats half the purpose of using Maven in the first place, doesn't it?

On Wed, Jun 9, 2010 at 1:54 PM, jid1jid1 <[hidden email]> wrote:

BTW, I tried declaring as war and it is working. Is there a workaround (not
by declaring it as war) ?



--
View this message in context: http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28833794.html
Sent from the Maven Eclipse - User mailing list archive at Nabble.com.


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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

jid1jid1
Well,
it might not be the best design, but I define interfaces required by external apps to create plugins. Moreover I also need to set file encoding to unix and scripts as executables, that can not be done from the pom itself. I can get the classes in another module but how can I fix my files? Wouldn't unpacking the jar worse design?

I can " blame" maven for not creating multiple packaging and change file types.
Or maybe there could be a convert option in eclipse?
Or even an identifier in the pom itself?

Any comments welcomed
Thanx


Tim Schwenk wrote
Boy, I really doubt it.  The whole idea of m2eclipse is that the POM becomes
the authoritative source of configuration for your project.  In other words,
if your artifact declares itself to be a war, then the m2eclipse WTP
integration can set up Eclipse accordingly - i.e. apply the appropriate
facets and such.  If it declares itself to be a jar, then how is m2eclipse
supposed to know that it's *really* a war masquerading as a jar?

Which raises the question: why on earth are you declaring the packaging to
be jar and then turning around and creating a war with the assembly plugin?
 That kind of defeats half the purpose of using Maven in the first place,
doesn't it?

On Wed, Jun 9, 2010 at 1:54 PM, jid1jid1 <jid1@dharma.gr> wrote:

>
> BTW, I tried declaring as war and it is working. Is there a workaround (not
> by declaring it as war) ?
>
>
>
> --
> View this message in context:
> http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28833794.html
> Sent from the Maven Eclipse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

Tim Schwenk
OK, I think I see the problem.  You need to break this project out into at least three modules - one 'war' to hold the actual webapp, one (or more) 'jar' to hold the interfaces on which other projects will depend, and one 'pom' to hold all the other stuff that you're going to assemble with the assembly plugin.  Then, your war project can depend on the 'jar' project with the interfaces, and your 'pom' project can assemble everything.

Whenever you think that Maven is broken because it won't let you create multiple artifacts from a single project, the real problem is that you need to restructure your project.  Think about this: should other projects really have a dependency on your web application?  No, the only reason they do now is that you put the plugin interfaces into the web app instead of into a separate jar.  Also, since when do web applications contain shell scripts?  They don't - your assembly may very well need to contain shell scripts, but the web application itself shouldn't.

So, if it were my project, I would create a top level parent POM to provide inheritance and aggergation for the module projects - and maybe even handle the assembly also.  Then create a war project and a jar project and let these inherit from the parent POM.  The war project will have a dependency on the jar project. The directory structure might look like this:

project
    pom.xml  <-- top level parent POM
    assembly.xml
    src/main/assembly/   <-- shell scripts and such for the assembly
    project-war
       pom.xml
       src/main/java
       src/main/resources
       src/main/webapp
       src/test/resources
       src/test/java
    project-jar
       pom.xml
       src/main/java
       src/main/resources
       src/main/webapp
       src/test/resources
       src/test/java

Once you get everything rearranged so that you can build from the command line, then you should be able to go to Eclipse and do File->Import->Existing Maven Project and select the directory containing the top level POM.  From this, m2eclipse will be able to locate the top level project and both module projects, import them and configure everything so that you can deploy and run your war on a test server.

Of course, knowing nothing about the size, nature, or complexity of your project, this may be much easier said than done.  However, this (or some variation of this) is really the right thing to do and probably the only way that you're going to get m2eclipse to provide the functionality that you're looking for.  FWIW, we do something similar to this at work, although the assembly is even further removed than what I've illustrated - it's a totally separate project in another diretory tree entirely - and m2eclipse works like a charm.

On Wed, Jun 9, 2010 at 4:33 PM, jid1jid1 <[hidden email]> wrote:

Well,
it might not be the best design, but I define interfaces required by
external apps to create plugins. Moreover I also need to set file encoding
to unix and scripts as executables, that can not be done from the pom
itself. I can get the classes in another module but how can I fix my files?
Wouldn't unpacking the jar worse design?

I can " blame" maven for not creating multiple packaging and change file
types.
Or maybe there could be a convert option in eclipse?
Or even an identifier in the pom itself?

Any comments welcomed
Thanx



Tim Schwenk wrote:
>
> Boy, I really doubt it.  The whole idea of m2eclipse is that the POM
> becomes
> the authoritative source of configuration for your project.  In other
> words,
> if your artifact declares itself to be a war, then the m2eclipse WTP
> integration can set up Eclipse accordingly - i.e. apply the appropriate
> facets and such.  If it declares itself to be a jar, then how is m2eclipse
> supposed to know that it's *really* a war masquerading as a jar?
>
> Which raises the question: why on earth are you declaring the packaging to
> be jar and then turning around and creating a war with the assembly
> plugin?
>  That kind of defeats half the purpose of using Maven in the first place,
> doesn't it?
>
> On Wed, Jun 9, 2010 at 1:54 PM, jid1jid1 <[hidden email]> wrote:
>
>>
>> BTW, I tried declaring as war and it is working. Is there a workaround
>> (not
>> by declaring it as war) ?
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28833794.html
>> Sent from the Maven Eclipse - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28835513.html
Sent from the Maven Eclipse - User mailing list archive at Nabble.com.


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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

jid1jid1
Well, sounds like a plan, though the jar already has just the interfaces.
The project has already modules for the actual implementations but the interfaces require j2ee Libs provided by the container hence logically can live only in a webapp. The scripts are for webapp installation, so again belong there. Also breaking up jars might mess with eg hibernate annotations. Even if it's not the best design, I hate it when a non project related tool enforces my design(even if bad) .

I will break it up eventually though I will again get the error about attaching assemblies in the package goal :( or is it legal to do in a pom package?


Tim Schwenk wrote
OK, I think I see the problem.  You need to break this project out into at
least three modules - one 'war' to hold the actual webapp, one (or more)
'jar' to hold the interfaces on which other projects will depend, and one
'pom' to hold all the other stuff that you're going to assemble with the
assembly plugin.  Then, your war project can depend on the 'jar' project
with the interfaces, and your 'pom' project can assemble everything.

Whenever you think that Maven is broken because it won't let you create
multiple artifacts from a single project, the real problem is that you need
to restructure your project.  Think about this: should other projects really
have a dependency on your web application?  No, the only reason they do now
is that you put the plugin interfaces into the web app instead of into a
separate jar.  Also, since when do web applications contain shell scripts?
 They don't - your assembly may very well need to contain shell scripts, but
the web application itself shouldn't.

So, if it were my project, I would create a top level parent POM to provide
inheritance and aggergation for the module projects - and maybe even handle
the assembly also.  Then create a war project and a jar project and let
these inherit from the parent POM.  The war project will have a dependency
on the jar project. The directory structure might look like this:

project
    pom.xml  <-- top level parent POM
    assembly.xml
    src/main/assembly/   <-- shell scripts and such for the assembly
    project-war
       pom.xml
       src/main/java
       src/main/resources
       src/main/webapp
       src/test/resources
       src/test/java
    project-jar
       pom.xml
       src/main/java
       src/main/resources
       src/main/webapp
       src/test/resources
       src/test/java

Once you get everything rearranged so that you can build from the command
line, then you should be able to go to Eclipse and do File->Import->Existing
Maven Project and select the directory containing the top level POM.  From
this, m2eclipse will be able to locate the top level project and both module
projects, import them and configure everything so that you can deploy and
run your war on a test server.

Of course, knowing nothing about the size, nature, or complexity of your
project, this may be much easier said than done.  However, this (or some
variation of this) is really the right thing to do and probably the only way
that you're going to get m2eclipse to provide the functionality that you're
looking for.  FWIW, we do something similar to this at work, although the
assembly is even further removed than what I've illustrated - it's a totally
separate project in another diretory tree entirely - and m2eclipse works
like a charm.

On Wed, Jun 9, 2010 at 4:33 PM, jid1jid1 <jid1@dharma.gr> wrote:

>
> Well,
> it might not be the best design, but I define interfaces required by
> external apps to create plugins. Moreover I also need to set file encoding
> to unix and scripts as executables, that can not be done from the pom
> itself. I can get the classes in another module but how can I fix my files?
> Wouldn't unpacking the jar worse design?
>
> I can " blame" maven for not creating multiple packaging and change file
> types.
> Or maybe there could be a convert option in eclipse?
> Or even an identifier in the pom itself?
>
> Any comments welcomed
> Thanx
>
>
>
> Tim Schwenk wrote:
> >
> > Boy, I really doubt it.  The whole idea of m2eclipse is that the POM
> > becomes
> > the authoritative source of configuration for your project.  In other
> > words,
> > if your artifact declares itself to be a war, then the m2eclipse WTP
> > integration can set up Eclipse accordingly - i.e. apply the appropriate
> > facets and such.  If it declares itself to be a jar, then how is
> m2eclipse
> > supposed to know that it's *really* a war masquerading as a jar?
> >
> > Which raises the question: why on earth are you declaring the packaging
> to
> > be jar and then turning around and creating a war with the assembly
> > plugin?
> >  That kind of defeats half the purpose of using Maven in the first place,
> > doesn't it?
> >
> > On Wed, Jun 9, 2010 at 1:54 PM, jid1jid1 <jid1@dharma.gr> wrote:
> >
> >>
> >> BTW, I tried declaring as war and it is working. Is there a workaround
> >> (not
> >> by declaring it as war) ?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28833794.html
> >> Sent from the Maven Eclipse - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/m2eclipse-does-not-recognize-web-projects-tp28831380p28835513.html
> Sent from the Maven Eclipse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: m2eclipse does not recognize web projects

tophebboy
This post has NOT been accepted by the mailing list yet.
Hi everybody!
I have a similar issue, with the same version of Eclipse, and m2Eclipse 0.10 with its extensions. I'm trying to import 3 maven projects in Eclipse, and the web project is not recognised. I mean its web dependancies are not put in the build path of the project (so it doesn't compile).
It's weird because the projects are compiling under Netbeans...
Christophe BOUDJENNAH
Junior Project Leader - ALTEN DDPS