Vittery
Vittery

Reputation: 25

Fail in building and packaging logback-android

I am a new to maven world, and i just want to try and use the logback-android jar. But i can not download the v1.0.8-1 from the internet. Then I try to compile and package it from git. I do what it says on the project's home page in github (github.com/tony19/logback-android).

1.git clone ...-> ok;

2.mvn -P debug clean install -> but it says there are errors during testing and build failed.


Then i try to skip the testing phase.

mvn -P debug clean install -Dmaven.test.skip=true

At this time, it would say

" Path to denpendency: 1) com.github.tony19:logback-android-classic:jar:1.0.11-1-SNAPSHOT 2) com..github.tony19:logback-android-core:test-ja:testsr:1.0.11-1-SNAPSHOT ---------- 1 required artifact is missing. for artifact: com.github.tony19:logback-android-classic:jar:1.0.11-1-SNAPSHOT from the specitied remote repositories: central (http://repo1.maven.org/maven2), sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) "

It really installes the logback-android-core.jar in the local maven repository. But why the next step, building classic module would like to get the core module from the oss.sonatype.org net insteading of the local repository????


My Runing Environment: Git Bash(git version 1.8.1.msysgit.1) Apach Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800) java version: 1.7.0_11 Default locale: zh_CN, platform encoding: GBK OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

Upvotes: 0

Views: 215

Answers (1)

tony19
tony19

Reputation: 138676

The problem is logback-android-classic depends on a test-jar, which has a known problem in that the test-jar dependencies are still required even when tests are skipped with maven.test.skip.

The workaround is to use skipTests instead:

$ mvn -P debug clean install -DskipTests=true

Note the difference is that skipTests still builds the test source (creating the required test-jar) but does not run the tests, while maven.test.skip skips both.

However, from a recent commit in logback-android, it looks like you can just run makejar.sh from the root of the source directory.

Upvotes: 0

Related Questions