Skip to content

Commit 541b609

Browse files
committed
Improved Maven configuration.
1 parent 407715a commit 541b609

File tree

5 files changed

+229
-195
lines changed

5 files changed

+229
-195
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*.iws
2+
/target/
3+
/*/target/

pom.xml

+65-12
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,96 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0"
2-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
43
<modelVersion>4.0.0</modelVersion>
54

6-
<groupId>tdd-tutorial</groupId>
7-
<artifactId>tetris</artifactId>
5+
<groupId>net.orfjackal.tdd-tutorial</groupId>
6+
<artifactId>tdd-tetris-tutorial</artifactId>
87
<version>1.0-SNAPSHOT</version>
98
<packaging>jar</packaging>
109

11-
<name>TDD Tetris</name>
12-
<description>Tutorial for learning TDD by writing a Tetris</description>
10+
<name>TDD Tetris Tutorial</name>
11+
<description>
12+
Tutorial for learning TDD. You make a Tetris game by writing code to pass the test cases.
13+
</description>
14+
<url>http://github.com/orfjackal/tdd-tetris-tutorial</url>
15+
<inceptionYear>2008</inceptionYear>
1316

1417
<dependencies>
18+
19+
<!-- Testing frameworks -->
20+
1521
<dependency>
1622
<groupId>junit</groupId>
1723
<artifactId>junit</artifactId>
1824
<version>4.4</version>
1925
<scope>test</scope>
2026
</dependency>
21-
2227
<dependency>
23-
<groupId>org.jmock</groupId>
24-
<artifactId>jmock-junit3</artifactId>
25-
<version>2.4.0</version>
28+
<groupId>org.mockito</groupId>
29+
<artifactId>mockito-all</artifactId>
30+
<version>1.7</version>
2631
<scope>test</scope>
2732
</dependency>
33+
2834
</dependencies>
2935

3036
<build>
3137
<plugins>
3238

39+
<!-- Compiler and file encodings -->
40+
3341
<plugin>
3442
<artifactId>maven-compiler-plugin</artifactId>
3543
<configuration>
36-
<source>1.5</source>
37-
<target>1.5</target>
44+
<source>1.6</source>
45+
<target>1.6</target>
46+
<encoding>UTF-8</encoding>
3847
</configuration>
3948
</plugin>
4049

50+
<plugin>
51+
<artifactId>maven-resources-plugin</artifactId>
52+
<configuration>
53+
<encoding>UTF-8</encoding>
54+
</configuration>
55+
</plugin>
56+
57+
<!-- Test runner configuration -->
58+
59+
<plugin>
60+
<artifactId>maven-surefire-plugin</artifactId>
61+
<configuration>
62+
<includes>
63+
<include>**/*Test.java</include>
64+
</includes>
65+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
66+
</configuration>
67+
</plugin>
68+
69+
<!-- Assembling a distributable file
70+
(run "mvn clean package" and collect the .zip file from the /target directory) -->
71+
72+
<plugin>
73+
<artifactId>maven-assembly-plugin</artifactId>
74+
<inherited>false</inherited>
75+
<configuration>
76+
<attach>false</attach>
77+
<descriptors>
78+
<descriptor>src/main/assembly/src.xml</descriptor>
79+
</descriptors>
80+
</configuration>
81+
<executions>
82+
<execution>
83+
<id>make-assembly</id>
84+
<phase>package</phase>
85+
<goals>
86+
<goal>attached</goal>
87+
</goals>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
92+
<!-- Add sources to Maven repository when installing/deploying a release -->
93+
4194
<plugin>
4295
<artifactId>maven-source-plugin</artifactId>
4396
<executions>

src/main/assembly/src.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
4+
5+
<id>src</id>
6+
<formats>
7+
<format>zip</format>
8+
</formats>
9+
<includeBaseDirectory>true</includeBaseDirectory>
10+
11+
<fileSets>
12+
<fileSet>
13+
<excludes>
14+
<exclude>target/**</exclude>
15+
<exclude>*/target/**</exclude>
16+
<exclude>.git/**</exclude>
17+
</excludes>
18+
</fileSet>
19+
</fileSets>
20+
21+
</assembly>

tdd-tetris-tutorial.iml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module relativePaths="true" MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9+
<excludeFolder url="file://$MODULE_DIR$/target" />
10+
</content>
11+
<orderEntry type="inheritedJdk" />
12+
<orderEntry type="sourceFolder" forTests="false" />
13+
<orderEntry type="library" name="Maven: junit:junit:4.4" level="project" />
14+
<orderEntry type="library" name="Maven: org.mockito:mockito-all:1.7" level="project" />
15+
</component>
16+
</module>
17+

0 commit comments

Comments
 (0)