catekr / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

MAVEN, json-simple 1.1.1 depends on Junit #91

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
On central maven repo, 
http://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1 
json-simple pom reference junit in its dependencies.

What is the expected output? What do you see instead?
junit deps should be in test scope

What version of the product are you using? On what operating system?
1.1.1

Please provide any additional information below.
json-simple comes with junit wich leads to conflicts in maven projects using 
json-simple

Thanks

Original issue reported on code.google.com by colin...@gmail.com on 23 Sep 2013 at 2:15

GoogleCodeExporter commented 8 years ago
This is a one line fix, as the reporter has noted:

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.10</version>
  <!-- FIXME --> <scope>test</scope>
</dependency>

There is no reason to include junit as a runtime dependency. It also throws off 
the Android linker. To work around, you can use exclusions in your project's 
POM:

<dependency>
  <groupId>com.googlecode.json-simple</groupId>
  <artifactId>json-simple</artifactId>
  <version>1.1.1</version>
  <exclusions>
    <exclusion>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </exclusion>
    <!-- maven note: must manually exclude all ancestors
            see http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html -->
    <exclusion>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Original comment by xcolw...@gmail.com on 10 Feb 2014 at 10:09

GoogleCodeExporter commented 8 years ago
Hi problem is the same with Ivy
Dependency must be like : 

<dependencies>
    <dependency org="junit" name="junit" rev="4.10" force="true" conf="test->runtime(*),master(*)"/>
</dependencies>

Original comment by mart...@gmail.com on 13 Mar 2014 at 1:50

GoogleCodeExporter commented 8 years ago
Could you try to fix that little issue soon, perhaps in a 1.1.2 version ? It is 
annoying for your users.

Original comment by aheritier on 11 May 2014 at 8:49

GoogleCodeExporter commented 8 years ago
annoying++

For android builds using gradle:

compile group: 'com.googlecode.json-simple', name: 'json-simple', version: 
'1.1.1', transitive: false 

Original comment by hemisf...@gmail.com on 30 Jul 2015 at 9:46