Skip to content

Commit 2d19dfe

Browse files
committed
build: don't execute native2ascii-maven-plugin on every run as we don't modify translations frequently.
As "native2ascii" profile gets activated before executing any goals, this leads to a non-obvious outcome that "mvn clean <some goal>" command doesn't process resources. It happens because "native2ascii" profile doesn't get activated as the target/classes/ru/mystamps/i18n directory exists in the begginning and hasn't been removed yet. As a workaround you might use: - mvn -Pnative2ascii clean <some goal> - mvn clean; mvn <some goal>
1 parent aa81300 commit 2d19dfe

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

pom.xml

+35-18
Original file line numberDiff line numberDiff line change
@@ -969,24 +969,6 @@
969969
</configuration>
970970
</plugin>
971971

972-
<plugin>
973-
<groupId>org.codehaus.mojo</groupId>
974-
<artifactId>native2ascii-maven-plugin</artifactId>
975-
<version>${native2ascii.plugin.version}</version>
976-
<configuration>
977-
<srcDir>${basedir}/src/main/resources/ru/mystamps/i18n</srcDir>
978-
<targetDir>${project.build.outputDirectory}/ru/mystamps/i18n</targetDir>
979-
</configuration>
980-
<executions>
981-
<execution>
982-
<id>utf8-to-latin1</id>
983-
<goals>
984-
<goal>resources</goal>
985-
</goals>
986-
</execution>
987-
</executions>
988-
</plugin>
989-
990972
<plugin>
991973
<groupId>org.jacoco</groupId>
992974
<artifactId>jacoco-maven-plugin</artifactId>
@@ -1267,6 +1249,41 @@
12671249
</plugins>
12681250
</build>
12691251
</profile>
1252+
<profile>
1253+
<id>native2ascii</id>
1254+
<activation>
1255+
<file>
1256+
<missing>target/classes/ru/mystamps/i18n</missing>
1257+
</file>
1258+
</activation>
1259+
<build>
1260+
<plugins>
1261+
<!--
1262+
We assume that most of the time we don't modify translations.
1263+
So, we execute this plugin only on a first time and don't execute
1264+
it on the next runs. This should save us a little time on every
1265+
iteration during development on local environment.
1266+
-->
1267+
<plugin>
1268+
<groupId>org.codehaus.mojo</groupId>
1269+
<artifactId>native2ascii-maven-plugin</artifactId>
1270+
<version>${native2ascii.plugin.version}</version>
1271+
<configuration>
1272+
<srcDir>${basedir}/src/main/resources/ru/mystamps/i18n</srcDir>
1273+
<targetDir>${project.build.outputDirectory}/ru/mystamps/i18n</targetDir>
1274+
</configuration>
1275+
<executions>
1276+
<execution>
1277+
<id>utf8-to-latin1</id>
1278+
<goals>
1279+
<goal>resources</goal>
1280+
</goals>
1281+
</execution>
1282+
</executions>
1283+
</plugin>
1284+
</plugins>
1285+
</build>
1286+
</profile>
12701287
</profiles>
12711288

12721289
</project>

src/main/scripts/ci/check-build-and-verify.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
220220
print_status "$SPOTBUGS_STATUS" 'Run SpotBugs'
221221
fi
222222

223-
mvn --batch-mode --activate-profiles frontend verify -Denforcer.skip=true -DskipUnitTests=true \
223+
mvn --batch-mode --activate-profiles frontend,native2ascii verify -Denforcer.skip=true -DskipUnitTests=true \
224224
>verify-raw.log 2>&1 || VERIFY_STATUS=fail
225225
# Workaround for #538
226226
"$(dirname "$0")/filter-out-htmlunit-messages.pl" <verify-raw.log >verify.log

0 commit comments

Comments
 (0)