is there something special that needs to be done f...
# compiler
t
is there something special that needs to be done for intellij to correctly load and execute compiler plugins in a maven project? if i run straight from the ide it doesn't work - throws 500s with a stacktrace of
Copy code
! java.lang.NullPointerException: null
! at kotlin.coroutines.jvm.internal.ContinuationImpl.getContext(ContinuationImpl.kt:105)
! at kotlin.coroutines.jvm.internal.ContinuationImpl.intercepted(ContinuationImpl.kt:112)
! at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.intercepted(IntrinsicsJvm.kt:182)
! at kotlinx.coroutines.DelayKt.delay(Delay.kt:172)
but if i run
mvn compile
first, it works fine.
t
I built a workaround for this: Add a property:
Copy code
<properties>
    <maven.repo.path>${user.home}/.m2/repository</maven.repo.path>
  </properties>
Then configure the compiler plugin:
Copy code
<build>
    <testSourceDirectory>src/test/kotlin</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>

        <configuration>
          <args>
            <arg>-Xplugin=${maven.repo.path}/path/to/group/name-of-your-artifact/${artifact-version}/name-of-your-artifact-${artifact-version}.jar</arg>
          </args>
        </configuration>
      </plugin>
    </plugins>
  </build>
This way, intellij will pick it up and execute during compilation
t
thanks - it's a gross hack but necessary in this situation i guess