You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Andrei Ivanov (JIRA)" <ji...@apache.org> on 2018/09/24 07:15:00 UTC

[jira] [Reopened] (LOG4J2-2436) log4j-audit-maven-plugin should allow executions and binding to generate-test-sources phase

     [ https://issues.apache.org/jira/browse/LOG4J2-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Ivanov reopened LOG4J2-2436:
-----------------------------------

> log4j-audit-maven-plugin should allow executions and binding to generate-test-sources phase
> -------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2436
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2436
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Log4j-Audit
>    Affects Versions: Log4j-Audit 1.0.0
>            Reporter: Andrei Ivanov
>            Assignee: Ralph Goers
>            Priority: Major
>
> I have a module that packages various +audit+ related classes and I want to make some tests for them and I thought of defining a test catalog in _src/test/resources_ and the tests would use the generated audit event classes.
> The problem is that the generated audit classes always end up in _target/classes_ and in the packaged jar.
> I've tried to define a separate execution, similar to this [example|https://stackoverflow.com/questions/8587353/maven-how-to-handle-generated-sources-for-testonly], but it doesn't help.
> The _log4j-audit-maven-plugin_ doesn't see the configuration if it's defined inside an _execution_ section and it always invokes {{project.addCompileSourceRoot}}, no matter which phase.
> {code:xml}
> <plugin>
>     <groupId>org.apache.logging.log4j</groupId>
>     <artifactId>log4j-audit-maven-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>generate-test-sources</id>
>             <phase>generate-test-sources</phase>
>             <!-- a configuration section defined here is not recognized 😢-->
>         </execution>
>     </executions>
>     <configuration>
>         <packageName>test</packageName>
>         <outputDirectory>${project.build.directory}/generated-test-sources/log4j-audit</outputDirectory>
>         <catalogReaderAttributes>
>             <catalogFile>src/test/resources/audit-catalog.json</catalogFile>
>         </catalogReaderAttributes>
>     </configuration>
> </plugin>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)