I’d like to publish a JAR for a Play framework (2.3.7, java 1.8) project that depends on another Play app so that I can convert us from SBT to Gradle in pieces. However, the maven-publish plugin doesn’t seem to recognize the “java”, “scala” or “play” components. For example using the “maven-publish” plugin:
publishing {
publications {
mavenPlay(MavenPublication) {
from components.java
}
}
}
throws this error:
Exception thrown while executing model rule: PublishingPlugin.Rules#publishing
Could not find property ‘java’ on SoftwareComponentInternal set.
Which is surprising because the “play” plugin pulls in the “java” and “scala” plugins.
It seems like one could easily fix this by applying the “java” or “scala” or “maven” plugins; however, it seems like the “play” plugin and other plugins are in conflict because I get this error:
Failed to apply plugin [class ‘org.gradle.api.plugins.BasePlugin’]
Cannot add a configuration with name ‘default’ as a configuration with that name already exists.
I could use your guys’ advice to move forward.