svn-gvsig-desktop / trunk / org.gvsig.desktop / maven-howto.rst @ 40472
History | View | Annotate | Download (4.58 KB)
1 |
|
---|---|
2 |
- How to reduce the process of "install" to run as fast as possible. |
3 |
|
4 |
Can reduce install execution skiping test execution and compilation, |
5 |
javadoc generation, test signature checking, license checking, and |
6 |
attach sources in jar. |
7 |
|
8 |
mvn -Dsource.skip=true -Dmaven.test.skip=true -DskipTests -Dmaven.javadoc.skip=true -Danimal.sniffer.skip=true -Dlicense.skip=true install |
9 |
|
10 |
- How show the list of files that have problems with the header. |
11 |
|
12 |
mvn -Dlicense.quiet=false license:check |
13 |
|
14 |
- How to skip license check from command line:: |
15 |
|
16 |
mvn -Dlicense.skip=true install |
17 |
|
18 |
- How to skip attach sources in jar from command line:: |
19 |
|
20 |
mvn -Dsource.skip=true install |
21 |
|
22 |
- How to skip test compile from command line:: |
23 |
|
24 |
mvn -Dmaven.test.skip=true install |
25 |
|
26 |
- How to skip test execution from command line:: |
27 |
|
28 |
mvn -DskipTests install |
29 |
|
30 |
- How to skip javadoc generation from command line:: |
31 |
|
32 |
mvn -Dmaven.javadoc.skip=true install |
33 |
|
34 |
- How to skip test signature cheks from command line:: |
35 |
|
36 |
mvn -Danimal.sniffer.skip=true install |
37 |
|
38 |
- How to install a project without install submodules |
39 |
|
40 |
mvn --non-recursive install |
41 |
|
42 |
- How to check and fix the header of source files. |
43 |
|
44 |
To check the header use:: |
45 |
|
46 |
mvn license:check |
47 |
|
48 |
To fix the header use:: |
49 |
|
50 |
mvn license:format |
51 |
|
52 |
- How to skip test compilation:: |
53 |
|
54 |
<build> |
55 |
<plugins> |
56 |
... |
57 |
<plugin> |
58 |
<!-- Skip compilation tests --> |
59 |
<groupId>org.apache.maven.plugins</groupId> |
60 |
<artifactId>maven-compiler-plugin</artifactId> |
61 |
<executions> |
62 |
<execution> |
63 |
<id>default-testCompile</id> |
64 |
<phase>process-test-sources</phase> |
65 |
<goals> |
66 |
<goal>testCompile</goal> |
67 |
</goals> |
68 |
<configuration> |
69 |
<skip>true</skip> |
70 |
</configuration> |
71 |
</execution> |
72 |
</executions> |
73 |
</plugin> |
74 |
... |
75 |
</plugins> |
76 |
</build> |
77 |
|
78 |
- Skip test execution:: |
79 |
|
80 |
<build> |
81 |
<plugins> |
82 |
... |
83 |
<plugin> |
84 |
<!-- Skip test execution --> |
85 |
<groupId>org.apache.maven.plugins</groupId> |
86 |
<artifactId>maven-surefire-plugin</artifactId> |
87 |
<configuration> |
88 |
<skipTests>true</skipTests> |
89 |
</configuration> |
90 |
</plugin> |
91 |
... |
92 |
</plugins> |
93 |
</build> |
94 |
|
95 |
- Continue on test failure :: |
96 |
|
97 |
<build> |
98 |
<plugins> |
99 |
... |
100 |
<plugin> |
101 |
<!-- Continue on test failure --> |
102 |
<groupId>org.apache.maven.plugins</groupId> |
103 |
<artifactId>maven-surefire-plugin</artifactId> |
104 |
<configuration> |
105 |
<testFailureIgnore>true</testFailureIgnore> |
106 |
</configuration> |
107 |
</plugin> |
108 |
... |
109 |
</plugins> |
110 |
</build> |
111 |
|
112 |
|
113 |
- Set java compatibility:: |
114 |
|
115 |
<build> |
116 |
<plugins> |
117 |
... |
118 |
<plugin> |
119 |
<!-- Set java compatibility --> |
120 |
<groupId>org.apache.maven.plugins</groupId> |
121 |
<artifactId>maven-compiler-plugin</artifactId> |
122 |
<configuration> |
123 |
<source>1.5</source> |
124 |
<target>1.5</target> |
125 |
<encoding>ISO-8859-1</encoding> |
126 |
</configuration> |
127 |
</plugin> |
128 |
... |
129 |
</plugins> |
130 |
</build> |
131 |
|
132 |
- Packaging tests in jar |
133 |
|
134 |
Test classes do not packaging in jar by default. |
135 |
To packing add to pom:: |
136 |
|
137 |
<build> |
138 |
<plugins> |
139 |
... |
140 |
<plugin> |
141 |
<!-- Packaging tests in jar --> |
142 |
<groupId>org.apache.maven.plugins</groupId> |
143 |
<artifactId>maven-jar-plugin</artifactId> |
144 |
<executions> |
145 |
<!-- Generates a jar file only with the test classes --> |
146 |
<execution> |
147 |
<goals> |
148 |
<goal>test-jar</goal> |
149 |
</goals> |
150 |
<configuration> |
151 |
<includes> |
152 |
<include>**/**</include> |
153 |
</includes> |
154 |
</configuration> |
155 |
</execution> |
156 |
</executions> |
157 |
</plugin> |
158 |
... |
159 |
</plugins> |
160 |
</build> |
161 |
|
162 |
- How to set a dependency with tests jar:: |
163 |
|
164 |
<dependency> |
165 |
<groupId>...</groupId> |
166 |
<artifactId>...</artifactId> |
167 |
<type>test-jar</type> |
168 |
<scope>test</scope> |
169 |
</dependency> |
170 |
|
171 |
- How use ant in maven:: |
172 |
|
173 |
<plugin> |
174 |
<artifactId>maven-antrun-plugin</artifactId> |
175 |
<version>1.7</version> |
176 |
<executions> |
177 |
<execution> |
178 |
<phase>generate-sources</phase> |
179 |
<configuration> |
180 |
<target> |
181 |
<echo>Hello world!</echo> |
182 |
</target> |
183 |
</configuration> |
184 |
<goals> |
185 |
<goal>run</goal> |
186 |
</goals> |
187 |
</execution> |
188 |
</executions> |
189 |
</plugin> |
190 |
|