생각하는 족족 고.따.구 냐..

Posted
Filed under About Knowledge/Programs_Java
...
apply plugin: 'java'
apply plugin: 'maven-publish'
...

...
jar {
    into("META-INF/maven/$project.group/$project.name") {
        from { generatePomFileForMavenJavaPublication }
        rename ".*", "pom.xml"
    }
}
...



group 'com.my-group'
version '1.0'

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifactId = rootProject.name
            from components.java
            versionMapping {
                usage('java-api') {
                    fromResolutionOf('runtimeClasspath')
                }
                usage('java-runtime') {
                    fromResolutionResult()
                }
            }
        }
    }

    repositories {
        maven {
            credentials {
                username 'username'
                password 'password'
            }
            url 'http://localhost:8081/repository/my/'
        }
    }
}

============================================================================
gradle clean build -x test publish

============================================================================

https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html
2021/03/23 10:57 2021/03/23 10:57