Skip to content

Commit

Permalink
documentation improved
Browse files Browse the repository at this point in the history
  • Loading branch information
jveverka committed Mar 3, 2022
1 parent 3ce47d8 commit ac87977
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ which shows log4j 1.2.12 dependency.
This obsolete version of log4j is not part of runtime, but is found by security scan tools in the local maven cache.

### Reproduce the problem
* compile the project with clean maven cache.
```
rm -rf ~/.m2/repository/*
git clone https://github.com/jveverka/mvn-dependency-log4j.git
Expand All @@ -20,6 +21,13 @@ mvn clean install
ls -la ~/.m2/repository/log4j/log4j/

This comment has been minimized.

Copy link
@pzygielo

pzygielo Mar 4, 2022

@jveverka What is your result for that command?

This comment has been minimized.

Copy link
@jveverka

jveverka Mar 4, 2022

Author Owner

the result is that project compiles normally and local maven cache contains log4j/log4j/ pom files

juraj@WORKSTATION:~/.m2/repository$ ls -la log4j/log4j/1.2.12/
total 20
drwxrwxr-x 2 juraj juraj 4096 mar 4 18:51 .
drwxrwxr-x 3 juraj juraj 4096 mar 4 18:51 ..
-rw-rw-r-- 1 juraj juraj 145 mar 4 18:51 log4j-1.2.12.pom
-rw-rw-r-- 1 juraj juraj 136 mar 4 18:51 log4j-1.2.12.pom.sha1
-rw-rw-r-- 1 juraj juraj 166 mar 4 18:51 _remote.repositories

# log4j 1.2.12 is downloaded by maven dependency plugin
```
* remove maven maven-dependency-plugin from [pom.xml](pom.xml) and compile the project with clean maven cache.
```
rm -rf ~/.m2/repository/*
mvn clean install
ls -la ~/.m2/repository/log4j/log4j/
# log4j 1.2.12 is NOT downloaded by maven dependency plugin
```

### Expected behaviour
``mvn clean install`` does not cause download of ``log4j:log4j:1.2.12`` into local ``~/.m2/repository`` maven cache.
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@

<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<!-- remove maven-dependency-plugin in order to remove log4j dependency -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down

0 comments on commit ac87977

Please sign in to comment.