Skip to content
hursevich edited this page Sep 20, 2016 · 7 revisions

Environment requirements

Generating project

The easiest way to initialize new project is to you Carina archetype, you will get correct project structure along with test samples. First clone archetype repo:

git clone https://github.com/qaprosoft/carina-archetype.git

Navigate to cloned repo and execute:

mvn install

Now go to folder where you need to generate new project and execute (do not forget to set groupId, artifactId, name, url, version):

mvn archetype:generate -DarchetypeGroupId=com.qaprosoft \
                       -DarchetypeArtifactId=carina \
                       -DarchetypeVersion=1.0 \
                       -DgroupId=<your_groupId> \ 
                       -DartifactId=<your_artifactId> \ 
                       -Dname="<you_proj_name>" \
                       -Durl=<your_proj_url> \
                       -Dversion=<your_proj_version>

The command should be executed without '' symbols on one line, leaving single white space between the attributes. If any attribute contains spaces, it should be set in quoted(e.g.: -Dname="Hello World"). In the Maven command listed above, you have to specify 5 attributes while the first 3 should be left unchanged. Let's go through these attributes:

Attribute Meaning Example
-DgroupId Company domain in reverce order com.qaprosoft
-DartifactId Java project name carina-qa
-Dname Name with more details "Carina Test Automation"
-Durl Company URL http://qaprosoft.com
-Dversion Project version 1.0

Import to Eclipse

If generation finishes successfully, you should see a new project folder with a name equal to the artifactId attribute specified during generation, so navigate to that folder (where pom.xml is located) and execute the following Maven task:

mvn clean eclipse:eclipse

Using this command, Maven should resolve all dependencies, downloading required libraries to your local repository and generating Eclipse classpath. Before importing a new project to Eclipse, you must link your IDE with your Maven repository by executing the following task:

mvn -Dworkspace=<path_to_workspace> eclipse:configure-workspace

Here you have to specify the absolute path to the Eclipse workspace. After that, restart Eclipse IDE. Now you may import generated projects such as "Existing Java Project" into Eclipse IDE. Generate eclipse workspace using command:

mvn clean eclipse:eclipse

Now you are ready to import project into eclipse.

Eclipse view