Skip to content

Commit f8da1dc

Browse files
committed
chore: cache detected Scala version
1 parent 51f3680 commit f8da1dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/scala_maven/ScalaMojoSupport.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,16 @@ protected List<Dependency> getDependencies() {
321321
return project.getCompileDependencies();
322322
}
323323

324+
private VersionNumber detectedScalaVersion = null;
325+
324326
private VersionNumber findScalaVersion() throws Exception {
327+
if (detectedScalaVersion == null) {
328+
detectedScalaVersion = findScalaVersion0();
329+
}
330+
return detectedScalaVersion;
331+
}
332+
333+
private VersionNumber findScalaVersion0() throws Exception {
325334
String detectedScalaVersion = scalaVersion;
326335
if (StringUtils.isEmpty(detectedScalaVersion)) {
327336
detectedScalaVersion =

0 commit comments

Comments
 (0)