Skip to content

Commit

Permalink
Fixed #80 - Error message "Log4j2 could not find a logging implementa…
Browse files Browse the repository at this point in the history
…tion"
  • Loading branch information
khmarbaise committed May 6, 2020
1 parent 6b80238 commit 5aacc99
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
:issue-76: https://github.com/khmarbaise/maven-it-extension/issues/76[Fixed #76]
:issue-77: https://github.com/khmarbaise/maven-it-extension/issues/77[Fixed #77]
:issue-78: https://github.com/khmarbaise/maven-it-extension/issues/78[Fixed #78]
:issue-80: https://github.com/khmarbaise/maven-it-extension/issues/80[Fixed #80]
:issue-81: https://github.com/khmarbaise/maven-it-extension/issues/81[Fixed #81]
:issue-84: https://github.com/khmarbaise/maven-it-extension/issues/84[Fixed #84]

Expand All @@ -48,12 +49,15 @@

* With {issue-68} - we have renamed the `@MavenIT` annotation into `@MavenJupiterExtension` to make the
intention more clear.
* With {issue-80} - We have removed the previously needed log4j dependencies at all. In testing
projects there is no need anymore in adding `log4j-core` dependency.

*Reporters of this release*

* Roland Weisleder
** {issue-76} - "Getting started" is hard to find.
** {issue-77} - Code in section "Configuration in Maven" (user guide) should be copy-pastable
** {issue-80} - Error message "Log4j2 could not find a logging implementation"

*Contributors of this release*

Expand Down
4 changes: 0 additions & 4 deletions itf-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
<scope>test</scope>
</dependency>
<!-- end::dependencies[] -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
</dependencies>


Expand Down
4 changes: 0 additions & 4 deletions itf-jupiter-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import com.soebes.itf.jupiter.maven.MavenProjectResult;
import com.soebes.itf.jupiter.maven.ProjectHelper;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.maven.model.Model;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.junit.jupiter.api.extension.BeforeEachCallback;
Expand Down Expand Up @@ -68,8 +66,6 @@
public class MavenITExtension implements BeforeEachCallback, ParameterResolver, BeforeTestExecutionCallback,
InvocationInterceptor {

private static final Logger LOGGER = LogManager.getLogger();

@Override
public void beforeEach(ExtensionContext context) {
Class<?> testClass = context.getTestClass()
Expand Down Expand Up @@ -172,8 +168,7 @@ public void beforeTestExecution(ExtensionContext context)

Optional<File> mvnLocation = new MavenLocator().findMvn();
if (!mvnLocation.isPresent()) {
LOGGER.error(() -> String.format("We could not find the maven executable `mvn` somewhere"));
throw new IllegalStateException("We can't find maven executable anywhere.");
throw new IllegalStateException(String.format("We could not find the maven executable `mvn` somewhere"));
}

ApplicationExecutor mavenExecutor = new ApplicationExecutor(directoryResolverResult.getProjectDirectory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* under the License.
*/

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.condition.OS;

import java.io.File;
Expand All @@ -46,7 +44,6 @@
* but they also lack the support of toFile().
*/
class MavenLocator {
private static final Logger LOGGER = LogManager.getLogger();

private static final String MAVEN_HOME = "maven.home";

Expand Down Expand Up @@ -116,7 +113,6 @@ Optional<File> checkExecutableViaPathEnvironment() {
for (String item : split) {
Optional<File> mvnLocation = checkExecutable(Paths.get(item));
if (mvnLocation.isPresent()) {
LOGGER.debug(() -> String.format("mvnLocation: '%s'", mvnLocation));
return mvnLocation;
}
}
Expand All @@ -128,9 +124,6 @@ Optional<File> findMvn() {
if (s.isPresent()) {
Optional<File> file = checkExecutable(Paths.get(s.get(), "bin"));
if (!file.isPresent()) {
LOGGER.error(() -> String.format(
"We couldn't find an mvn executable via maven.home system property: '%s'",
System.getProperty(MAVEN_HOME)));
return Optional.empty();
}
return checkExecutableViaPathEnvironment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* under the License.
*/

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apiguardian.api.API;

import java.util.stream.Stream;
Expand Down Expand Up @@ -49,8 +47,6 @@ public enum MavenVersion {
M3_6_2("3.6.2"),
M3_6_3("3.6.3");

private static final Logger LOGGER = LogManager.getLogger();

private static final MavenVersion CURRENT_MAVEN_VERSION = determineCurrentVersion();

private final String versionString;
Expand Down
4 changes: 0 additions & 4 deletions itf-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.13.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
Expand Down

0 comments on commit 5aacc99

Please sign in to comment.