Skip to content
jesfre edited this page Jul 26, 2014 · 4 revisions

Use this tool to add Maven support to a Web project that doesn't fit to the Maven standards.

To use the tool follow these steps:


Download and unzip the tool

  1. Download the tool from GitHub. This file contains:

a ) The mavenizer tool project-mavenizer-0.0.1.jar

b ) An example of a non-standard Maven Web project (NonStandardWebProject)

c ) The file sample.properties. You will rename it (optional) and edit to use with your own project.

  1. Unzip the file project-mavenizer-pack.zip in a well known path, say, c:\mavenizator\project-mavenizer-pack\

Set your configurations

  1. Open and edit the file in c:\mavenizator\project-mavenizer-pack\sample.properties following the instructions in the same file. As a resume, you must set the next values.

a ) Set the project name. this will be also the name of the generated .war file. Say, mymavenproject.

b ) Set the location to the folder of your project. Say, c:\mavenizator\project-mavenizer-pack\NonStandardWebProject

c) Set the Web content folder of the Web project. Say, c:\mavenizator\project-mavenizer-pack\NonStandardWebProject\WebContent

d ) Set the source folders of the project. See the examples in the file and change it.

e ) Set the path to the folder that contains all the libraries used by your project as classpath. See the example in the file.

Mavenize the project

  1. Open a command line tool and go to the unziped folder. In the next examples I'm using MS-DOS.

  2. From the command line tools, on c:\mavenizator\project-mavenizer-pack\, run: c:\mavenizator\project-mavenizer-pack > java -jar project-mavenizer-0.0.1.jar.

The tool will ask you for the Properties file. Set sample.properties or whatever you have set to it. Make sure that the Properties file is in the same directory than the project-mavenizer-0.0.1.jar.

You must see something like:

C:\mavenizator\project-mavenizer-pack>java -jar project-mavenizer-0.0.1.jar

Set the properties file name:

sample.properties

Loading /C:/mavenizator/project-mavenizer-pack/sample.properties

Generated file is: C:/mavenizator/project-mavenizer-pack/NonStandardWebProject\pom.xml

C:\mavenizator\project-mavenizer-pack>

The result will be a new pom.xml file generated in the root folder of your project. Say, c:\mavenizator\project-mavenizer-pack\NonStandardWebProject\pom.xml

Test it

  1. Now you can use your project as a Maven Web project. To run the project, in the command line, go to the project folder and invoke the next Maven command: c:\mavenizator\project-mavenizer-pack\NonStandardWebProject > mvn clean tomcat7:run. This command will start an embeded Tomcat7 within the project.

  2. If you can see something like this Starting ProtocolHandler ["http-bio-9966"] whitout previous errors. Open the link http://localhost:9966/mymavenproject/ from an Internet navigator.

Clone this wiki locally