The json-simple
jar is missing in packaged WAR because it is marked as optional
in spring-boot-starter-parent
, BUT I do include a dependency gelfj
that declares json-simple
as dependency..... example below (used with Maven 3.3.3):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.giveandtake</groupId>
<artifactId>main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
</parent>
<name>main</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.graylog2</groupId>
<artifactId>gelfj</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.2.3.RELEASE</version>
</dependency>
</dependencies>
</project>
[1] when packaging war with maven 3.0.4 i get the json-simple inside war (without asking for the jar explicitly).
[2] when packaging with maven 3.3.x war i dont have this jar in my war(unless i explicitly ask for it) file.
which leaves me with these questions:
Question 1: if i have ProjectX-->(Inherit)Spring-boot-Parent and also declare a dependency Y that has dependency for json-simple, shouldnt the dependency for simple-json be transitive into war and recognize that as not optional anymore?
Question 2: why is the different results with different maven versions [maven bug? , searched for release notes but didnt find anything matching]