Fail in building and packaging logback-android

I want to do log in my android's application.

Searche for the log component and finally feel logback-android should be great.

But can not download the newer version jar file (1.0.8-1...)

So try to compile and package as what it says on the github page.

Fail to pakcage.

The way to get the jar file is bumpy, as I am a newer to the maven world, especially in the first maven step:

"

mvn -P debug clean install
"

There would be errors in testing.

At last, I got help from the "stackoverflow" communicty.

You must to skip the testing.

To share it with others, I copy the content from "stackoverflow":

 

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_11Default locale: zh_CN, platform encoding: GBKOS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

 

1 Answer

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.



References:

http://stackoverflow.com/questions/16250201/fail-in-building-and-packaging-logback-android

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值