Skip to content

Commit

Permalink
Disable vulnerable log4j dependency and add note.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 8, 2022
1 parent 5292f33 commit ad83979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions native-image-workshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ $ mvn clean package -Pnative
So far, so good. But say we now we want to add a library, or some code, to our project that
relies on reflection. A good candidate for testing this out would be to add `log4j`. Let's do that.

We've already added it as a dependency in the `pom.xml` file, and it can be seen in the depencies:
We've already added it as a dependency in the `pom.xml` file, and it can be found in the dependencies. Please uncomment it:

```xml
<dependency>
<!-- <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependency> -->
```

To add `log4j` all we need to do is to open up the `ListDir.java` file and uncomment some things in order to start using it. Go through and uncomment the various lines that add the imports and the logging code. Uncomment the following lines:
Expand Down
5 changes: 3 additions & 2 deletions native-image-workshop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
<version>${graalvm.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<!-- Warning: the below log4j dependency is insecure and must not be used in production -->
<!-- <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.1.3</version>
</dependency>
</dependency> -->
</dependencies>

<profiles>
Expand Down

0 comments on commit ad83979

Please sign in to comment.