-1

I would like to use maven as build/release management/manage the dependencies tool for our web application.

Our Web application project directory structure as below

-WebContext
------|src
--------|com.company
------|WEB-INF
------|pages

as per maven, directory structure should be as below

-WebContext
------|src
--------|main
------------|java
------------|test
------------|resources
------------|webapp

since code(old directory structure ) is maintained by SCM (CVS) if we convert to the new maven directory structure following are the questions

  1. If i changed directory structure then files need to be recommit in CVS ? if yes it is not possible to commit the all files as project size is huge and there were many tags exists in SCM and there exists client releases.

  2. Is there any best way to convert as maven project without disturbing the existing structure?

  3. Currently Resources are in root directory let them to be as it is instead of moving to src/main/resources

I think it is common problem for all and hope there is a solution for this, can any one guide me to use maven as build/release management tool.

Thanks Dhorrairaajj

Dhorrairaajj
  • 55
  • 11
  • Hope this link may help you easily: http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/ – Imran Oct 01 '14 at 14:09
  • Thank you for point a link, but actually i am looking for how SCM repository(CVS) will impact with the project structure after converted to maven structure. – Dhorrairaajj Oct 06 '14 at 04:36

1 Answers1

0

It's possible to configure Maven to look for your code in src rather than src/main/java. But if you want to follow the recommended Maven project layout and put your code in src/main/java, I'd recommend switching away from CVS (to something like Git or SVN) first.

CVS tracks revisions independently for each file, identified by the file's path. If you move or rename a file (which changes its path), CVS thinks you deleted it and created a new one, which means that if you look at the (new) file's revision history, you won't see any changes that were made prior to the move or rename. The old path and the new path are completely different, unrelated files as far as CVS is concerned.

Some CVS users work around this limitation by also moving or renaming the associated ,v file that holds the revision history, but that effectively changes history: if you check out an earlier revision of the project, the file will be at the new location, as if it had been there from the beginning. If you have branches based on older revisions, the file's location will have changed on those branches too. This can cause builds of older versions or branches to fail, since the file isn't in the place the build system expected it to be in those versions. And build problems aside, an SCM repository is of limited usefulness if its records of your project's history are inaccurate.

Newer SCM systems like Git and SVN are able to handle moves/renames properly, as well as providing many other improvements over CVS. This is a good opportunity to move your project to a system that's less archaic.

Wyzard
  • 33,849
  • 3
  • 67
  • 87
  • Thank you for detailed explanation, our project consists of many (100+) tags and no. of branches shall we setup SVN/Git to exact repository without disturbing the existing setup and can able to build project based on branches and tags? – Dhorrairaajj Oct 06 '14 at 04:12
  • There are tools for converting a CVS repositiory into a newer system like Git or SVN, including all branches and tags. – Wyzard Oct 07 '14 at 03:30