You are on page 1of 15

Software System Verification and Validation www.cs.ubbcluj.

ro/~avescan

Maven + SVN tutorial – IntelliJ IDEA

IntelliJ IDEA

Contents
IntelliJ IDEA ...................................................................................................................................................... 1
1. Configuration Maven in Intellij IDEA ...................................................................................................... 2
2. Create proiect Maven.............................................................................................................................. 3
3. Install plug-in Maven to run multi-thread (failsafe) ............................................................................... 5
4. Configuration to use JUnit in Maven project ......................................................................................... 8
5. Install plugin SVN for IntelliJ IDEA........................................................................................................ 10
6. Upload Maven project to SVN .............................................................................................................. 11
7. Visualizing the Maven project in the SVN repository ............................................................................ 15

www.cs.ubbcluj.ro/~cretu 1
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

1. Configuration Maven in Intellij IDEA


1. In meniu File ---> Settings ---> Plugins;
2. click Browse Directories, then search with maven
integration and install plugin Maven 2 Integration (see Figure 1);

Figure 1 Instalre Maven 2 Integration in IntelliJ IDEA

www.cs.ubbcluj.ro/~cretu 2
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

2. Create proiect Maven


1. In meni File ---> New ---> Project;
2. select Maven;
3. mark Create from archetype;
4. select maven-archetype-quickstart (Error! Reference source not found.2), then
Next;

Figure 2. Creare proiect Maven

5. Add information to Group Id (your SCS id) (see Error! Reference source not
found.3);
 e.g., user with address xyir1234@scs.ubbcluj.ro, will have Group Id
xyir1234MV;
6. Add information to Artifact Id (your SCS id)
 e.g., user with address xyir1234@scs.ubbcluj.ro, will have Artifact Id
xyir1234;

www.cs.ubbcluj.ro/~cretu 3
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

Figure 3 Configure GroupID and ArtifaactID for project Maven

7. Then Next; configure the repository and visaualized the configurations (see Figure
4),then Next;

Figure 4 Configurations for Maven project

8. Add the name of the project and the folder where it will be created (see Figure
525), then Finish to finalized the creation of the Maven project.

www.cs.ubbcluj.ro/~cretu 4
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

Figure 52 Name of the Maven project and the associated folder

3. Install plug-in Maven to run multi-thread (failsafe)


1. In meniu File ---> Settings ---> Plugins;
2. Click on Browse Directories, then search with failsafe and
install the plugin Maven Test Support Plugin (see Error! Reference source not
found.6);

Figure 5 Installl plugin faisafe in IntelliJ iDEA

3. After the installation, reopen intelliJ IDEA (see Figure 6);

www.cs.ubbcluj.ro/~cretu 5
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

Figure 6 Restart IntelliJ IDEA

4. Add in the file pom.xml the configuration to use the plugins failsafe and surefire
(see Error! Reference source not found.7 and Figure 8):
<project>
………………
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
</plugin>
</plugins>
</build>
…………………
</project>

Figure 7 Configuration in pom.xml

Figure 83 Add failsafe in the project in file pom.xml

www.cs.ubbcluj.ro/~cretu 6
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

5. In meniu File ---> Settings ---> Build, Execution, Deployment ---> Required
Plugins add the required plugins for the current project (see Figure 949).

Figure 94 Plugins required for the current project

www.cs.ubbcluj.ro/~cretu 7
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

4. Configuration to use JUnit in Maven project


1. In meniu File ---> Settings ---> Build, Execution, Deployment ---> Required
Plugins ---> Maven ---> Importing;
2. Check/select Import Maven projects automatically and the file pom.xml will be
modified implicitly to use JUnit 3.8.1 (see Figure10);

Figure 10 Auto-import JUnit for Maven projects

3. The created project Maven has a source (main) and test (test);
4. Add the Java files from your application (Lab 01) in folder src from the Maven
created project, both source code (in main/<groupID>) and tests
(test/<groupID>);
5. To use JUnit 4, open a file with test cases that use adnotations (e.g., @Test,
@Ignore), and then Alt+Enter;
6. Add JUnit 4 to the Maven project (see Figure 11511);

Figure 115 Add JUnit 4to the Maven project

www.cs.ubbcluj.ro/~cretu 8
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

7. Dependencies are automatically updated (vezi Figure 1612);

Figure 16 Dependencies are automatically updated for the Maven project

8. In file pom.xml an implicit dependency for JUnit 4 is added; if a Junit 3.8.1


dependency already exists, this can be deletedfrom the file pom.xml;

www.cs.ubbcluj.ro/~cretu 9
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

5. Install plugin SVN for IntelliJ IDEA


1. In meni File ---> Settings ---> Plugins;
2. Click one Browse Directories, then search and add
subversion integration and install SVNToolBox (see Figure );

Figure 13 Install plugin for SVN

3. After install, reopen intelliJ IDEA (see Figure );

www.cs.ubbcluj.ro/~cretu 10
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

6. Upload Maven project to SVN


1. Data to access the repository are:
o User Name: avescan
o Password:123456

2. Connection configuraton to the Repository


1. In meniu File ---> Settings ---> Version Control ---> Subversion
 tab General, unchecked Use command line client (see Figure 714);

Figure 7 Configuration tab General in Version Control Settings

 tab SSH Settings add the information (see Figure 15):


 User name: VVSS;
 Checked the item: Password;

Figure 15 Configuration tab SSH Settings in Version Control Settings

www.cs.ubbcluj.ro/~cretu 11
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

3. Create URL for Repository


1.In meniu VCS ---> Checkout from version Control ---> Subversion (see Figure 16)

Figure 16 Checkout for repository

2. Create an URL to the Repository from the address (see Figure 17817):
http://subversion.assembla.com/svn/ssvv2017/

Figure 178 Create URL for Repository

www.cs.ubbcluj.ro/~cretu 12
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

4. Add project to the Repository


1. Search for the folder (Destination Directory) with the source code that will be added
to the Repository (see Figure 18), select the folder, then OK;

Figure 18 Select Destination Directory for Repository

2.Configurations for the selected Repositorys (see Figure ), then OK;

Figure 19 Configurations for checkout

3. Establish the version for the working format with the source code (see Figure
20920);

Figure 209 Version for the working format with the source code

www.cs.ubbcluj.ro/~cretu 13
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

4. In meniu VCS ---> Commit changes… adding the source code (see Figure
211021);
 Add a mesage Commit Message: first commit, then Commit.

Figure 2110 Adding the source code

www.cs.ubbcluj.ro/~cretu 14
Software System Verification and Validation www.cs.ubbcluj.ro/~avescan

7. Visualizing the Maven project in the SVN repository


1. Use a web browser for the address
https://www.assembla.com/home ;
2. Login with the following credentials:
 user: avescan
 password: 123456
3. Accessing the repository with the id ssvv2017 or link
http://subversion.assembla.com/svn/ssvv2017/.

www.cs.ubbcluj.ro/~cretu 15

You might also like