I'm running into an error in my .pom files when building builds. I have separated the project into different daughter libraries but now when uploading a version to be able to use this library in other apps I have encountered a problem. In my generated .pom file I am finding dependencies like this:
<dependency>
<groupId>NameLibrary</groupId>
<artifactId>id</artifactId>
<version>unspecified</version>
<scope>runtime</scope>
</dependency>
The version number comes to me "unspecified". I have read some posts about how to modify the .pom file before it is uploaded to place a version but they are not working for me. It seems that the posts I have read are outdated since they are from a few years ago.
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
}
...
plugins {
id 'maven-publish'
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'XXXXXXX'
artifactId = 'XXXXXXX'
version = 'XXXXXXX'
}
}
}
}
Some of the solutions are using pom.whenConfigured but that method does not appear to me, so I do not know if it is a problem with the version that I have or if it is another problem.