2013-02-21 3 views
2

maven으로 빌드되지 않은 Android 라이브러리 (사용자 정의 된 통합 zxing 바코드 스캐너 lib)가 있습니다. 그래서 mvn install : install-file을 사용하여 로컬 maven 저장소에 apklib를 만들려고합니다. non-maven Android 라이브러리 프로젝트에 대한 apklib 생성이 실패했습니다.

그러므로 나는 실행 명령 행에 다음을 반환

mvn install:install-file -Dfile=zxing-integrated-1.0.apklib \ 
         -DgroupId=com.google.zxing \ 
         -DartifactId=zxing-integrated \ 
         -Dversion=1.0 \ 
         -Dpackaging=apklib \ 
         -DgeneratePom=true \ 
         -DcreateChecksum=true 

:

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Maven Stub Project (No POM) 1 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom --- 
[INFO] Installing /Users/myuser/Projects/myproject/zxing/zxing-integrated-1.0.apklib to /Users/myuser/.m2/repository/com/google/zxing/zxing-integrated/1.0/zxing-integrated-1.0.apklib 
[INFO] Installing /var/folders/s0/0qcqwh696150dhq_lb0l3pd80000gn/T/mvninstall735817733736670848.pom to /Users/myuser/.m2/repository/com/google/zxing/zxing-integrated/1.0/zxing-integrated-1.0.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.488s 
[INFO] Finished at: Thu Feb 21 11:27:23 CST 2013 
[INFO] Final Memory: 7M/94M 
[INFO] ------------------------------------------------------------------------ 

하지만 없는 apklib 파일

을 받는다는의 repo에서 생성되고있다. 내가 할 모든이 :

enter image description here

그래서 위의 설치 파일 명령 뭐가 잘못 됐는지, 궁금합니다. 이것은 apklib를 빌드하려고하는 lib 프로젝트의 프로젝트 구조입니다. 그것은 일반 안드로이드 프로젝트 구조는 다음 (나는 가정하고 있지 안드로이드 Maven 프로젝트 구조는 할 수있는 올바른 방법인가?)

enter image description here

나는 MVN 내 주요 프로젝트, 치어의 설치를 실행합니다. XML은 다음과 같습니다

<dependency> 
     <groupId>com.google.zxing</groupId> 
     <artifactId>zxing-integrated</artifactId> 
     <version>1.0</version> 
     <type>apklib</type> 
    </dependency> 

나는 점점 오전 :

> mvn install 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building com.myproject.subname.android 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/zxing-integrated/1.0/zxing-integrated-1.0.jar 
Downloading: http://repo1.maven.org/maven2/com/google/zxing/zxing-integrated/1.0/zxing-integrated-1.0.jar 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 10.128s 
[INFO] Finished at: Thu Feb 21 11:13:20 CST 2013 
[INFO] Final Memory: 11M/137M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project com.myproject.subname.android: Could not resolve dependencies for project com.myproject:com.myproject.subname.android:apk:1.0-SNAPSHOT: Could not find artifact com.google.zxing:zxing-integrated:jar:1.0 in snapshots-repository (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

답변

3

받는다는 설치 파일의 목표는 단지 ​​업로드 기존 파일을 로컬 저장소에 저장합니다. 파일을 만들지 않습니다. 명령으로 업로드 할 수 있도록 기존 파일 zxing-integrated-1.0.apklib이 있어야합니다.

+0

글쎄, 내가 더 신중하게 문서를 읽었어야 것 같아요. 그 점을 지적 해 주셔서 감사합니다. 이제 괜찮아. –