Skip to content

Commit 0c0a3ca

Browse files
authored
Adjust config (eugenp#3979)
* Adjust config * Adjust config * Adjust config * fix * fix * Rename MetricTypeTest * Rename MetricTypeTest * Rename MetricTypeTest * Rename MetricTypeTest * Install custom pmd jar to local maven repo during maven validate phase, so that it becomes available during project build * maven install plugin - adding base path * changed the phase for maven directory plugin to validate to make sure that the base directory variable is available to maven install plugin * pmd violation flag back to false
1 parent 23162f1 commit 0c0a3ca

6 files changed

Lines changed: 51 additions & 16 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ spring-security-openid/src/main/resources/application.properties
3434

3535
spring-all/*.log
3636

37-
*.jar
38-
3937
SpringDataInjectionDemo/.mvn/wrapper/maven-wrapper.properties
4038

4139
spring-call-getters-using-reflection/.mvn/wrapper/maven-wrapper.properties

custom-pmd-0.0.1.jar

3.21 KB
Binary file not shown.

custom-pmd/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.baeldung.pmd</groupId>
55
<artifactId>custom-pmd</artifactId>
6-
<version>0.0.1-SNAPSHOT</version>
6+
<version>0.0.1</version>
77
<packaging>jar</packaging>
88
<name>custom-pmd</name>
99
<url>http://maven.apache.org</url>
@@ -40,4 +40,4 @@
4040
</plugin>
4141
</plugins>
4242
</build>
43-
</project>
43+
</project>

metrics/src/test/java/com/baeldung/metrics/servo/MetricTypeTest.java renamed to metrics/src/test/java/com/baeldung/metrics/servo/MetricTypeManualTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import com.netflix.servo.monitor.Stopwatch;
3333
import com.netflix.servo.stats.StatsConfig;
3434

35-
public class MetricTypeTest {
35+
public class MetricTypeManualTest {
3636

3737
@Test
3838
public void givenDefaultCounter_whenManipulate_thenCountValid() {

pmd/custom-pmd-0.0.1.jar

3.21 KB
Binary file not shown.

pom.xml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
</reporting>
4040

4141
<modules>
42-
<module>custom-pmd</module>
4342
<module>parent-boot-5</module>
4443
<module>asm</module>
4544
<module>atomix</module>
@@ -362,7 +361,6 @@
362361

363362
<build>
364363
<plugins>
365-
366364
<plugin>
367365
<groupId>org.codehaus.mojo</groupId>
368366
<artifactId>exec-maven-plugin</artifactId>
@@ -371,8 +369,7 @@
371369
<executable>maven</executable>
372370
</configuration>
373371
</plugin>
374-
375-
<plugin>
372+
<plugin>
376373
<groupId>org.apache.maven.plugins</groupId>
377374
<artifactId>maven-surefire-plugin</artifactId>
378375
<version>${maven-surefire-plugin.version}</version>
@@ -388,7 +385,6 @@
388385
</excludes>
389386
</configuration>
390387
</plugin>
391-
392388
<plugin>
393389
<groupId>org.apache.maven.plugins</groupId>
394390
<artifactId>maven-compiler-plugin</artifactId>
@@ -398,7 +394,6 @@
398394
<target>1.8</target>
399395
</configuration>
400396
</plugin>
401-
<!-- TODO till we sort it out
402397
<plugin>
403398
<groupId>org.apache.maven.plugins</groupId>
404399
<artifactId>maven-pmd-plugin</artifactId>
@@ -407,11 +402,11 @@
407402
<dependency>
408403
<groupId>org.baeldung.pmd</groupId>
409404
<artifactId>custom-pmd</artifactId>
410-
<version>0.0.1-SNAPSHOT</version>
405+
<version>0.0.1</version>
411406
</dependency>
412407
</dependencies>
413408
<configuration>
414-
<failurePriority>5</failurePriority> &lt;!&ndash; TODO change to 0 after fixing the project &ndash;&gt;
409+
<failurePriority>5</failurePriority> <!-- TODO change to 0 after fixing the project -->
415410
<aggregate>true</aggregate>
416411
<failOnViolation>false</failOnViolation>
417412
<verbose>true</verbose>
@@ -420,7 +415,7 @@
420415
<sourceEncoding>UTF-8</sourceEncoding>
421416
<targetJdk>1.8</targetJdk>
422417
<rulesets>
423-
<ruleset>${user.dir}/baeldung-pmd-rules.xml</ruleset>
418+
<ruleset>${tutorialsproject.basedir}/baeldung-pmd-rules.xml</ruleset>
424419
</rulesets>
425420
</configuration>
426421
<executions>
@@ -432,7 +427,49 @@
432427
</execution>
433428
</executions>
434429
</plugin>
435-
-->
430+
<plugin>
431+
<groupId>org.commonjava.maven.plugins</groupId>
432+
<artifactId>directory-maven-plugin</artifactId>
433+
<version>0.3.1</version>
434+
<executions>
435+
<execution>
436+
<id>directories</id>
437+
<goals>
438+
<goal>directory-of</goal>
439+
</goals>
440+
<phase>validate</phase>
441+
<configuration>
442+
<property>tutorialsproject.basedir</property>
443+
<project>
444+
<groupId>com.baeldung</groupId>
445+
<artifactId>parent-modules</artifactId>
446+
</project>
447+
</configuration>
448+
</execution>
449+
</executions>
450+
</plugin>
451+
<plugin>
452+
<groupId>org.apache.maven.plugins</groupId>
453+
<artifactId>maven-install-plugin</artifactId>
454+
<version>2.5.1</version>
455+
<configuration>
456+
<groupId>org.baeldung.pmd</groupId>
457+
<artifactId>custom-pmd</artifactId>
458+
<version>0.0.1</version>
459+
<packaging>jar</packaging>
460+
<file>${tutorialsproject.basedir}/custom-pmd-0.0.1.jar</file>
461+
<generatePom>true</generatePom>
462+
</configuration>
463+
<executions>
464+
<execution>
465+
<id>install-jar-lib</id>
466+
<goals>
467+
<goal>install-file</goal>
468+
</goals>
469+
<phase>validate</phase>
470+
</execution>
471+
</executions>
472+
</plugin>
436473
</plugins>
437474

438475
<extensions>
@@ -444,4 +481,4 @@
444481
</extensions>
445482

446483
</build>
447-
</project>
484+
</project>

0 commit comments

Comments
 (0)