Skip to content

Commit fb5142a

Browse files
committed
adjust pom profiles so no extra deps brought in for other modules.
1 parent 692080d commit fb5142a

File tree

4 files changed

+86
-79
lines changed

4 files changed

+86
-79
lines changed

.kokoro/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test)
5353
;;
5454
test-logging)
5555
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
56-
mvn test -P '!slf4j2x,slf4j2x-test' -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
56+
mvn clean test -P '!slf4j2x,slf4j2x-test' -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
5757
RETURN_CODE=$?
5858
;;
5959
lint)

oauth2_http/javatests/com/google/auth/oauth2/Slf4jUtilsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void testGetLogger_loggingDisabled_shouldGetNOPLogger() {
6565
assertFalse(logger.isDebugEnabled());
6666
}
6767

68+
// This test require binding (e.g. logback) be present
6869
@Test
6970
public void testGetLogger_loggingEnabled_slf4jBindingPresent() {
7071
testEnvironmentProvider.setEnv(LoggingUtils.GOOGLE_SDK_JAVA_LOGGING, "true");

oauth2_http/pom.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,89 @@
7171
</plugins>
7272
</build>
7373
</profile>
74+
<profile>
75+
<id>slf4j2x</id>
76+
<activation>
77+
<activeByDefault>true</activeByDefault>
78+
</activation>
79+
<build>
80+
<plugins>
81+
<plugin>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<version>3.13.0</version>
84+
<configuration>
85+
<source>1.8</source>
86+
<target>1.8</target>
87+
<encoding>UTF-8</encoding>
88+
89+
<!-- excluding tests depending on logback/env var by default -->
90+
<testExcludes>
91+
<testExclude>**/Slf4jUtilsLogbackTest.java</testExclude>
92+
<testExclude>**/Slf4jUtils1xTest.java</testExclude>
93+
<testExclude>**/Slf4jUtilsTest.java</testExclude>
94+
<testExclude>**/TestAppender.java</testExclude>
95+
<testExclude>**/LoggingTest.java</testExclude>
96+
</testExcludes>
97+
</configuration>
98+
</plugin>
99+
</plugins>
100+
</build>
101+
<dependencies>
102+
<dependency>
103+
<groupId>org.slf4j</groupId>
104+
<artifactId>slf4j-api</artifactId>
105+
<version>${project.slf4j.version}</version>
106+
<optional>true</optional>
107+
</dependency>
108+
</dependencies>
109+
</profile>
110+
<profile>
111+
<id>slf4j2x-test</id>
112+
<!-- This profile is for logging test only,
113+
use instead of the default slf4j2x.
114+
This should merge with parent modules same name profile-->
115+
<build>
116+
<plugins>
117+
<plugin>
118+
<artifactId>maven-compiler-plugin</artifactId>
119+
<version>3.13.0</version>
120+
<configuration>
121+
<source>1.8</source>
122+
<target>1.8</target>
123+
<encoding>UTF-8</encoding>
124+
<!-- excluding tests depending on logback/env var by default -->
125+
<testIncludes>
126+
<testInclude>**/Slf4jUtilsLogbackTest.java</testInclude>
127+
<testInclude>**/Slf4jUtils1xTest.java</testInclude>
128+
<testInclude>**/Slf4jUtilsTest.java</testInclude>
129+
<testInclude>**/TestAppender.java</testInclude>
130+
<testInclude>**/LoggingTest.java</testInclude>
131+
</testIncludes>
132+
</configuration>
133+
</plugin>
134+
</plugins>
135+
</build>
136+
<dependencies>
137+
<dependency>
138+
<groupId>org.slf4j</groupId>
139+
<artifactId>slf4j-api</artifactId>
140+
<version>${project.slf4j.version}</version>
141+
</dependency>
142+
<!-- Logback for testing -->
143+
<dependency>
144+
<groupId>ch.qos.logback</groupId>
145+
<artifactId>logback-classic</artifactId>
146+
<version>1.5.16</version>
147+
<scope>test</scope>
148+
</dependency>
149+
<dependency>
150+
<groupId>ch.qos.logback</groupId>
151+
<artifactId>logback-core</artifactId>
152+
<version>1.5.16</version>
153+
<scope>test</scope>
154+
</dependency>
155+
</dependencies>
156+
</profile>
74157
</profiles>
75158

76159
<build>

pom.xml

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
<project.protobuf.version>3.25.5</project.protobuf.version>
8585
<project.cel.version>0.9.0-proto3</project.cel.version>
8686
<project.tink.version>1.15.0</project.tink.version>
87-
<project.gson.version>2.11.0</project.gson.version>
8887
<project.slf4j.version>2.0.16</project.slf4j.version>
8988
</properties>
9089

@@ -285,15 +284,6 @@
285284
<source>1.8</source>
286285
<target>1.8</target>
287286
<encoding>UTF-8</encoding>
288-
289-
<!-- &lt;!&ndash; excluding tests depending on logback/env var by default &ndash;&gt;-->
290-
<!-- <testExcludes>-->
291-
<!-- <testExclude>**/Slf4jUtilsLogbackTest.java</testExclude>-->
292-
<!-- <testExclude>**/Slf4jUtils1xTest.java</testExclude>-->
293-
<!-- <testExclude>**/Slf4jUtilsTest.java</testExclude>-->
294-
<!-- <testExclude>**/TestAppender.java</testExclude>-->
295-
<!-- <testExclude>**/LoggingTest.java</testExclude>-->
296-
<!-- </testExcludes>-->
297287
</configuration>
298288
</plugin>
299289
<plugin>
@@ -430,64 +420,18 @@
430420
</reporting>
431421

432422
<profiles>
433-
<profile>
434-
<id>slf4j2x</id>
435-
<activation>
436-
<activeByDefault>true</activeByDefault>
437-
</activation>
438-
<build>
439-
<plugins>
440-
<plugin>
441-
<artifactId>maven-compiler-plugin</artifactId>
442-
<version>3.13.0</version>
443-
<configuration>
444-
<source>1.8</source>
445-
<target>1.8</target>
446-
<encoding>UTF-8</encoding>
447-
448-
<!-- excluding tests depending on logback/env var by default -->
449-
<testExcludes>
450-
<testExclude>**/Slf4jUtilsLogbackTest.java</testExclude>
451-
<testExclude>**/Slf4jUtils1xTest.java</testExclude>
452-
<testExclude>**/Slf4jUtilsTest.java</testExclude>
453-
<testExclude>**/TestAppender.java</testExclude>
454-
<testExclude>**/LoggingTest.java</testExclude>
455-
</testExcludes>
456-
</configuration>
457-
</plugin>
458-
</plugins>
459-
</build>
460-
<dependencies>
461-
<dependency>
462-
<groupId>org.slf4j</groupId>
463-
<artifactId>slf4j-api</artifactId>
464-
<version>${project.slf4j.version}</version>
465-
<optional>true</optional>
466-
</dependency>
467-
</dependencies>
468-
</profile>
469-
470423
<profile>
471424
<id>slf4j2x-test</id>
472-
<!-- This profile is for logging test only
473-
mvn clean test -P '!slf4j2x,slf4j2x-test'
474-
-->
475-
<modules>
476-
477-
<module>credentials</module>
478-
<module>oauth2_http</module>
479-
</modules>
425+
<!-- This profile is for logging test only, use instead of the default slf4j2x -->
480426
<build>
481427
<plugins>
482-
483428
<plugin>
484429
<artifactId>maven-compiler-plugin</artifactId>
485430
<version>3.13.0</version>
486431
<configuration>
487432
<source>1.8</source>
488433
<target>1.8</target>
489434
<encoding>UTF-8</encoding>
490-
491435
<!-- excluding tests depending on logback/env var by default -->
492436
<testIncludes>
493437
<testInclude>**/Slf4jUtilsLogbackTest.java</testInclude>
@@ -500,27 +444,6 @@
500444
</plugin>
501445
</plugins>
502446
</build>
503-
<dependencies>
504-
<dependency>
505-
<groupId>org.slf4j</groupId>
506-
<artifactId>slf4j-api</artifactId>
507-
<version>${project.slf4j.version}</version>
508-
</dependency>
509-
<!--gets gson from com.google.http-client:google-http-client-gson-->
510-
<!-- Logback for testing -->
511-
<dependency>
512-
<groupId>ch.qos.logback</groupId>
513-
<artifactId>logback-classic</artifactId>
514-
<version>1.5.16</version>
515-
<scope>test</scope>
516-
</dependency>
517-
<dependency>
518-
<groupId>ch.qos.logback</groupId>
519-
<artifactId>logback-core</artifactId>
520-
<version>1.5.16</version>
521-
<scope>test</scope>
522-
</dependency>
523-
</dependencies>
524447
</profile>
525448
<profile>
526449
<id>release-sign-artifacts</id>

0 commit comments

Comments
 (0)