Skip to content

Commit 633b721

Browse files
Vladimir.ShapkinVladimir.Shapkin
authored andcommitted
Removed binary file with test data.
Added building test data in test-lib.jar before compilation.
1 parent 08d9555 commit 633b721

File tree

6 files changed

+113
-8
lines changed

6 files changed

+113
-8
lines changed

pom.xml

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ SOFTWARE.
8181
<url>https://github.com/yegor256/cactoos</url>
8282
</site>
8383
</distributionManagement>
84+
<properties>
85+
<additionalClasspathElements>${project.build.directory}/${project.artifactId}-test-lib-${project.version}.jar</additionalClasspathElements>
86+
</properties>
8487
<dependencies>
8588
<dependency>
8689
<groupId>org.takes</groupId>
@@ -106,13 +109,6 @@ SOFTWARE.
106109
</exclusion>
107110
</exclusions>
108111
</dependency>
109-
<dependency>
110-
<groupId>files</groupId>
111-
<artifactId>test-data</artifactId>
112-
<version>0.0.1</version>
113-
<scope>system</scope>
114-
<systemPath>${basedir}/src/test/resources/test-data-0.0.1.jar</systemPath>
115-
</dependency>
116112
<dependency>
117113
<groupId>com.google.code.findbugs</groupId>
118114
<artifactId>annotations</artifactId>
@@ -137,12 +133,21 @@ SOFTWARE.
137133
</dependency>
138134
</dependencies>
139135
<build>
136+
<resources>
137+
<resource>
138+
<directory>${basedir}/src/test/resources</directory>
139+
<filtering>true</filtering>
140+
<excludes>
141+
<exclude>test-lib/**</exclude>
142+
</excludes>
143+
</resource>
144+
</resources>
140145
<testResources>
141146
<testResource>
142147
<directory>${basedir}/src/test/resources</directory>
143148
<filtering>true</filtering>
144149
<excludes>
145-
<exclude>test-data-0.0.1.jar</exclude>
150+
<exclude>test-lib/**</exclude>
146151
</excludes>
147152
</testResource>
148153
</testResources>
@@ -160,6 +165,8 @@ SOFTWARE.
160165
<threads>8</threads>
161166
<mutationThreshold>75</mutationThreshold>
162167
<timeoutConstant>500</timeoutConstant>
168+
<additionalClasspathElements>${additionalClasspathElements}</additionalClasspathElements>
169+
<useClasspathJar>true</useClasspathJar>
163170
</configuration>
164171
</execution>
165172
</executions>
@@ -188,6 +195,59 @@ SOFTWARE.
188195
</execution>
189196
</executions>
190197
</plugin>
198+
<plugin>
199+
<groupId>org.apache.maven.plugins</groupId>
200+
<artifactId>maven-surefire-plugin</artifactId>
201+
<configuration>
202+
<additionalClasspathDependencies>
203+
<additionalClasspathDependency>
204+
<groupId>org.cactoos</groupId>
205+
<artifactId>${project.artifactId}-test-lib</artifactId>
206+
<version>${project.version}</version>
207+
</additionalClasspathDependency>
208+
</additionalClasspathDependencies>
209+
</configuration>
210+
</plugin>
211+
<plugin>
212+
<groupId>org.apache.maven.plugins</groupId>
213+
<artifactId>maven-assembly-plugin</artifactId>
214+
<executions>
215+
<execution>
216+
<id>make-test-lib</id>
217+
<phase>initialize</phase>
218+
<goals>
219+
<goal>single</goal>
220+
</goals>
221+
<configuration>
222+
<finalName>${project.artifactId}-test-lib-${project.version}</finalName>
223+
<descriptors>
224+
<descriptor>${basedir}/src/test/resources/test-lib/assembly.xml</descriptor>
225+
</descriptors>
226+
<appendAssemblyId>false</appendAssemblyId>
227+
</configuration>
228+
</execution>
229+
</executions>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.apache.maven.plugins</groupId>
233+
<artifactId>maven-install-plugin</artifactId>
234+
<executions>
235+
<execution>
236+
<id>make-test-lib</id>
237+
<phase>initialize</phase>
238+
<goals>
239+
<goal>install-file</goal>
240+
</goals>
241+
<configuration>
242+
<file>${additionalClasspathElements}</file>
243+
<groupId>org.cactoos</groupId>
244+
<artifactId>${project.artifactId}-test-lib</artifactId>
245+
<version>${project.version}</version>
246+
<packaging>jar</packaging>
247+
</configuration>
248+
</execution>
249+
</executions>
250+
</plugin>
191251
<plugin>
192252
<groupId>org.jacoco</groupId>
193253
<artifactId>jacoco-maven-plugin</artifactId>
-3.6 KB
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
The MIT License (MIT)
4+
5+
Copyright (c) 2017-2025 Yegor Bugayenko
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included
15+
in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
-->
25+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
26+
<id>test-lib</id>
27+
<formats>
28+
<format>jar</format>
29+
</formats>
30+
<includeBaseDirectory>false</includeBaseDirectory>
31+
<fileSets>
32+
<fileSet>
33+
<directory>${project.basedir}/src/test/resources/test-lib</directory>
34+
<outputDirectory>/</outputDirectory>
35+
<includes>
36+
<include>org/cactoos/io/small-text-file.txt</include>
37+
<include>org/cactoos/io/dir/second-text-file.txt</include>
38+
<include>org/cactoos/io/dir/small-file-in-dir.txt</include>
39+
</includes>
40+
</fileSet>
41+
</fileSets>
42+
</assembly>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Second text file.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Small file in the directory.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Small file in the parent directory.

0 commit comments

Comments
 (0)