2016-12-27 3 views
1

OpenEdge 프로젝트를 빌드 할 때 Gradle을 Ant와 함께 사용하려고합니다. OpenEdge는 수 백년 전부터 4GL 언어입니다. ;-)Nexus에 gradle이있는 jar 파일 이외의 다른 파일 게시

어쨌든 일부 jar 종속성을 다운로드했지만 이제는 Nexus 저장소에 PL 파일 (진행 라이브러리)을 게시하는 방법에 주저하고 있습니다. 문제는 Maven과 마찬가지로 Gradle도 Java 프로젝트 용으로 만들어진 것입니다.

(나는 또한 rootProject.name의 = '스톰'과 settings.gradle 파일이) 내 스크립트입니다

C : Gradle을 실행

apply plugin:'java' 
apply plugin: 'maven-publish' 

group 'be.mips' 
version = '1.4.0-SNAPSHOT' 

repositories { 
    /* 
    Gradle uses the same logic as Maven to identify the location of your local 
    Maven cache. If a local repository location is defined in a settings.xml, 
    this location will be used. The settings.xml in USER_HOME/.m2 takes precedence 
    over the settings.xml in M2_HOME/conf. If no settings.xml is available, Gradle 
    uses the default location USER_HOME/.m2/repository. 
    */ 
    mavenLocal() 
    maven { 
    credentials { 
     username '****' 
     password '****' 
    } 
    url "http://srv-ci-nexus:8082/nexus/content/repositories/MadeApplReleases/" 
    url "http://srv-ci-nexus:8082/nexus/content/repositories/MadeApplSnapshots/" 
    } 
    mavenCentral() 
} 

def stompProgressLibraryFile = file('dist/lib/STOMP.PL') 

artifacts { 
    archives stompProgressLibraryFile 
} 

publishing { 
    publications { 
    mavenJava(MavenPublication) { 
     from components.java 
     artifact stompProgressLibraryFile 
    } 
    } 

    repositories { 
    maven { 
     // default credentials for a nexus repository manager 
     credentials { 
     username '****' 
     password '****' 
     } 
     // url to the releases maven repository 
     url "http://srv-ci-nexus:8082/nexus/repositories/snapshots" 
    } 
    } 
} 

configurations { 
    antconf 
} 

dependencies { 
    antconf 'be.mips:mips-progress-ant-tasks:1.5.8-SNAPSHOT', 
    'be.mips:mips-pct:1.0-SNAPSHOT', 
    'ant-contrib:ant-contrib:1.0b3' 
} 

/* Loads the jars */ 
ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader 
configurations.antconf.each { 
    File f -> antClassLoader.addURL(f.toURI().toURL()) 
} 

/* Extend clean task */ 
clean.doFirst { 
    delete '_ant_rcode', 'src', 'dist' 
    println 'deleted directories' 
} 

/* Create dist/lib directory as prolib does not create directory automatically */ 
task init(dependsOn: clean) { 
    doLast{ 
    project.file('dist/lib').mkdirs() 
    println 'created dist/lib' 
    } 
} 

ant.importBuild 'build.xml' 

게시 나에게 다음 출력을 제공합니다 : \ OBJECT \ GET-REPLITORIES \ OpenEdge \ stomp.git> gradle -DDLC = C : \ OpenEdge \ 116 \ DLC publish : generatePomFileForMavenJavaPublication : compileJava 최신 업데이트 : processResources 업데이트 날짜 : 클래스 UP-TO- 날짜 : jar 최신 날짜 : publishMavenJavaPublicationToMavenRep ository 메타 데이터 be.mips을 찾을 수 없습니다 : 스톰 : 원격 (http://srv-ci-nexus:8082/nexus/repositories/snapshots)에서 1.4.0-SNAPSHOT/받는다는-metadata.xml http://srv-ci-nexus:8082/nexus/repositories/snapshots/be/mips/stomp/1.4.0-SNAPSHOT/stomp-1.4.0-20161227.115652-1.pom 이 유물 be.mips을 전송할 수 없습니다 업로드 : 스톰 : POM : 1.4.0-20161227.115652를 -1 에서/원격 (http://srv-ci-nexus:8082/nexus/repositories/snapshots)에 : 업로드 http://srv-ci-nexus:8082/nexus/repositories/snapshots/be/mips/stomp/1.4.0-SNAPSHOT/stomp-1.4.0-20161227.115652-1.jar 을 '수/MIPS/스톰/1.4.0-SNAPSHOT/스톰 - 1.4.0-20161227.115652-1.pom'를 자원하지 쓸 수 수 be.mips : stomp : jar : 1.4.0-20161227.115652-1 from/remote (http://srv-ci-nexus:8082/nexus/repositories/snapshots) : 할 수 없었습니다 쓰기 리소스 012 3,516,'수/MIPS/스톰/1.4.0-SNAPSHOT/스톰 - 1.4.0-20161227.115652-1.jar' 업로드 http://srv-ci-nexus:8082/nexus/repositories/snapshots/be/mips/stomp/1.4.0-SNAPSHOT/stomp-1.4.0-20161227.115652-1.pl 유물 be.mips을 전송할 수 없습니다 : 스톰을 : PL : 1.4.0-20161227.115652-1 원격 (http://srv-ci-nexus:8082/nexus/repositories/snapshots)에 /에서 : 수 '수/MIPS/스톰/1.4.0-SNAPSHOT/stomp-1.4.0-20161227.115652-1.pl' 자원하지 쓰기 : publishMavenJavaPublicationToMavenRepository이

을 실패를 FAILURE : 예외가 발생하여 빌드가 실패했습니다.

  • 문제점 : 'publishMavenJavaPublicationToMavenRepository'작업에 실행하지 못했습니다.

    아티팩트를 배포 할 수 없습니다 '받는다는' 리포지토리에 게시 'mavenJava'를 게시하지 못했습니다 : 아티팩트 be.mips을 전송할 수 없습니다 : 스톰 : POM /까지 1.4.0-20161227.115652-1를 원격 (http://srv-ci-nexus:8082/nexus/repositories/snapshots) :

  • 시도를 '수/MIPS/스톰/1.4.0-SNAPSHOT/스톰 - 1.4.0-20161227.115652-1.pom'를 자원하지 작성할 수에 --stacktrace 옵션을 실행 스택 트레이스를 얻는다. 더 많은 로그 출력을 얻으려면 --info 또는 --debug 옵션을 사용하여 실행하십시오.

BUILD는

총 시간

을 실패 : 1.089 초

내가 필요하지 않은이 자바 작업을 데 주목 우선

을. : compileJava, : processResource, : classes, : jar ...

기본적으로 나는 원하는 모든 것을하는 build.xml ant 파일을 가지고있다. 그러나 개미의 의존성 관리는 매우 열악합니다. 그래서 Ant와 함께 Gradle을 사용하기로 결정했습니다. 나는 Gradle이 나를 위해 의존 관리를 해주기를 바란다. 지금까지 의존성 다운로드는 잘 작동하는 것 같습니다 (항아리 대신 PL로 시도해야합니다). 항아리가 아닌 다른 것을 발행하면 어떻게 할 수 있습니까?

많은 Gradle 온라인 설명서를 읽었지 만 모든 예제는 Java를 기반으로 한 것 같습니다.

답변

1

자바 코드를 컴파일 할 필요가없는 경우 java 대신 base 플러그인을 사용하십시오. 또한이 from components.java을 제거해야합니다 : 는 "자원을 쓸 수 없습니다"

apply plugin: 'base' 
apply plugin: 'maven-publish' 

publishing { 
    publications { 
    mavenJava(MavenPublication) { 
     artifact stompProgressLibraryFile 
    } 
    } 
} 

당신의 다음 오류은 Gradle을 문제가 저장소에 쓰기 권한을 확인하지 가능성이 높습니다. 원격 저장소에 게시하기 전에 로컬 저장소에 게시하려고 :

하는 플러그인을 적용 :

$ ./gradlew install 
+0

들으 :

apply plugin: "maven" 

작업 install을 실행! components.java에서 이미 제거되었습니다. 다음으로 기본 플러그인을 사용해 보겠습니다. 이상한 일이 온라인 Gradle User Guide에 잘 설명되어있는 것은 아닙니다 ... –