From what you expose, I don't see any reason that would prevent you
from using Maven. However, you will struggle a little bit to set up
sourceDirectory, warDirectory and resourcesDirectory since they are
all merged together. You can get around this by setting up correct
inclusion/exclusion filters (but I think they will be rather painful
to maintain).
It would be a lot easier if you can re-organize a bit the files ,
use maven standard structure (src/main/java, src/main/resources,
src/main/webapp ...) and reorganize the projects so that they are
not sub-folders of each other.
Last time I have set up this kind of project I used the following
structure (although there are maybe better solutions, but I found
this quite useful):
Root parent (you define here anything that should be shared
across your project: dependency versions, shared properties,
plugin management, etc...)
EJB's (to group all your EJB's together)
EJB-1 (an EJB project)
EJB-2 (another EJB project)
...
EAR's (to group all your EAR's together. if you have only
one then you can directly put it here instead of having an
intermediary node)
EAR-1 (an EAR project)
EAR-2 (another EAR project)
...
JAR's (to group all your standard jars together)
JAR-1
JAR-2
...
WAR's (to group all your wars together)
WAR-1
WAR-2
...
In this structure, all the nodes are 'pom' project and the leaves of
the structure are either 'jar', 'ejb', 'war' or 'ear' projects.
As this structure is quite heavy (but provides room for
extensibility), you can also use a lighter hierarchy:
Root
EJB-1
EJB-2
JAR-1
JAR-2
EAR-1
EAR-2
WAR-1
WAR-2
In this structure, only the root node is a 'pom' project, all the
others are either 'jar', 'ejb', 'war' or 'ear' projects.
In both structure, I would set up the 'pom' project(s) as aggregator
(you define the other projects as modules and they reference their
upper-level project as their parent).
Eventually, you will have to set up the JBoss5 dependencies (with
the scope provided). I think that the JBoss repository is now
located here:
https://repository.jboss.org/nexus/content/groups/public (but it's
been a while since I set this up so maybe with a fresher memory will
guide you better into which dependencies should be set up). Once you
have set up the proper dependencies, you can even remove the "JBoss
Container" library from the Eclipse build path. For your Struts
dependencies,you can search them here: http://search.maven.org/ and
add them where needed.
Cheers,
Guillaume
Le 22/09/2011 07:20, Khavnekar, Pravin a crit:
Hello,
We are newbies
in Maven. We have gone though the Maven Website and
develop small Projects on our own as mentioned for the
beginners. So far we are very much successful in
creating the basic Projects. However, now we want to
migrate our current Projects into Maven.
Unfortunately, we are facing lot of problems in that.
Could you please let us know whether our project
structure is feasible to migrate in to Maven? Please
find below the structure and technologies used in our
Project.
Technology:
Internet
Technology:
Servlet,
JSP, _javascript_, HTML, CSS and
AJAX.
Design Tools:
MyEclipse
6.0
Server Side
Technologies:
J2EE -
EJB 2.0, Hibernate
Frame Work
Used:
Struts
1.2
Database:
PL/SQL
Language: Java
Web Servers:
JBoss 5
Application
Server Used:
WAS
(Deployment Environment), JBoss Application Server.
Operating
Systems:
Win XP
(Development), Linux (Production Environment)
Project
Structure:
Please let us
know whether it is possible to use Maven and it would