1
votes

I'm trying to generate a jar file with Maven Assembly Plugin. All is correct except for my log4j.properties file; when I run the jar file the console output:

log4j:WARN No appenders could be found for logger (com.xxxxxxxxxx.web.processengine.Main). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

In Eclipse works well; so I assume is some type of compiling problem; here is my assembly plugin pom configuration:

<plugin>
        <artifactId>maven-assembly-plugin</artifactId>

        <configuration>
            <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>  
            <archive>
                <manifest>
                    <mainClass>com.xxxxxxxxx.web.processengine.Main</mainClass>
                </manifest>
            </archive>
        </configuration>

        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>
      </executions>
    </plugin>

I appreciate any help, thanks.

1
Is the log4j.properties included in the artifact at all?Anders R. Bystrup
Try putting a log4j.properties file in the src/main/resources folderBruno Grieder
@Anders R. Bystrup, I don't understand the question, where exactly is this artifact to include the file?svprdga
@BGR, you were right, I had the file under src/main/resources/META-INF, not directly under src/main/resources. Now works.svprdga
I will make it an answer so that you can close the questionBruno Grieder

1 Answers

1
votes

Try putting a log4j.properties file in the src/main/resources folder