Hi, I'm also using some custom plugins and several project and wars. I just succeeded to setup a maven build that generate the Log4j2Plugins.dat.
First I enable the annotation processor on the project that content my plugins: <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>process</id> <goals> <goal>process</goal> </goals> <phase>process-sources</phase> </execution> </executions> <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.0.1</version> </dependency> </dependencies> </plugin> And after I copy the Log4j2Plugins.dat from the generated archive (a jar in my case) to the finals wars: - I use unpack of the maven-dependency-plugin - I include the file in my wars. Clément On Fri, Aug 22, 2014 at 12:09 PM, Henrik Østerlund Gram < [email protected]> wrote: > Hi, > > I had been using the betas for a couple of years and everything was fine. > But unfortunately I cannot seem to make 2.0.x work. > > I have couple of plugins (converters) that are annotated properly, but the > automatic detection of these never did work and I had to use the follow > maven step to create the necessary Log4j2Plugins.dat for it to work. > > <plugin> <groupId>org.codehaus.mojo</groupId> > <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> > <executions> <execution> <phase>process-classes</phase> <goals> > <goal>java</goal> </goals> </execution> </executions> <configuration> > > <mainClass>org.apache.logging.log4j.core.config.plugins.PluginManager</mainClass> > <arguments> > <argument>${project.build.directory}/../src/main/resources</argument> > <argument>my.package</argument> </arguments> </configuration> </plugin> > But since rc2 the PluginManager was disabled, and it's now seemingly > impossible to get the plugins registered. The source for PluginManager > suggests looking at the configuration page supposedly using the packages > attr to tell the framework where to scan for plugins, but again, that just > doesn't work. I used that as well in the betas where it also did not work. > > Perhaps in trivial project setups it works fine, I don't know, but I have > an ear with multiple .wars and a common single log4j2 (present in the ear's > lib where the jar for my converters is also present) and I don't know why > it cannot pick it up. > > Any workarounds? I can't understand why it should be this difficult to > register a converter. > > Regards, >
