New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
README to include Maven setup #36
Comments
I'm not sure this is going to be possible without a Maven specific artifact. Looking at the documentation for the allopen plugin seems to imply that at least given it's use of It's been years since I've used Maven so if you give this a try, do let me know the results. It seems to me like Kotlin is pushing the use of Gradle, given Kotlin's own pause on Maven improvements on their roadmap. I'm definitely open to a contribution for this, but it will take a bit of convincing before I attempt this myself. |
If I ever get around to it this might a good reference implementation for a maven plugin (besides the official ones): https://www.github.com/intuit/hooks/tree/master/maven-plugin |
You don't need a Maven plugin. Yes, that's how JetBrains do it but as far as I can tell it's completely superfluous over-engineering (seems to be a common problem with java build systems!). I got it working by doing these steps:
Example: <plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<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>
<jvmTarget>15</jvmTarget>
<args>
<arg>-Xuse-ir</arg>
<arg>-P</arg><arg>plugin:com.bnorm.kotlin-power-assert:function=kotlin.assert</arg>
</args>
</configuration>
<dependencies>
<dependency>
<groupId>com.bnorm.power</groupId>
<artifactId>kotlin-power-assert-plugin</artifactId>
<version>0.8.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin> |
On further investigation, it appears that for maven->JPS sync to work properly, the Maven plugin is required. To use Maven directly, it isn't important. So you may need to delegate build actions to Maven. I prefer not to do that, and you can fix JPS by editing the IML file for the project or module to include:
but of course this isn't ideal. Really, the whole maven/gradle/compiler integration dance is way over the top. IntelliJ could easily generate the project from the POM correctly without this form of assistance. I'll file an IntelliJ bug. |
Step 1 shouldn't be required if you are doing all of this manually, just use artifact id |
You are correct! That does indeed work. Perhaps that version can just be renamed. |
@mikehearn Thank you for the POM snippet! |
Thanks for this plugin!
I'll figure this out for myself, but it would be helpful if
README.md
included instructions for Maven as well as Gradle.The text was updated successfully, but these errors were encountered: