log4j.xml relocated due to visibility issues and excluded from generated
JAR. pom.xml formatted according to coding conventions
This commit is contained in:
		
							
								
								
									
										85
									
								
								dao/pom.xml
									
									
									
									
									
								
							
							
						
						
									
										85
									
								
								dao/pom.xml
									
									
									
									
									
								
							| @@ -1,24 +1,69 @@ | ||||
| <?xml version="1.0"?> | ||||
| <project | ||||
| 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||||
| 	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||||
| 	<modelVersion>4.0.0</modelVersion> | ||||
| 	<parent> | ||||
| 		<groupId>com.iluwatar</groupId> | ||||
| 		<artifactId>java-design-patterns</artifactId> | ||||
| 		<version>1.8.0-SNAPSHOT</version> | ||||
| 	</parent> | ||||
| 	<artifactId>dao</artifactId> | ||||
|   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||||
|   xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||||
|   <modelVersion>4.0.0</modelVersion> | ||||
|   <parent> | ||||
|     <groupId>com.iluwatar</groupId> | ||||
|     <artifactId>java-design-patterns</artifactId> | ||||
|     <version>1.8.0-SNAPSHOT</version> | ||||
|   </parent> | ||||
|   <artifactId>dao</artifactId> | ||||
|  | ||||
| 	<dependencies> | ||||
| 		<dependency> | ||||
| 			<groupId>junit</groupId> | ||||
| 			<artifactId>junit</artifactId> | ||||
| 			<scope>test</scope> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<groupId>log4j</groupId> | ||||
| 			<artifactId>log4j</artifactId> | ||||
| 		</dependency> | ||||
| 	</dependencies> | ||||
|   <dependencies> | ||||
|     <dependency> | ||||
|       <groupId>junit</groupId> | ||||
|       <artifactId>junit</artifactId> | ||||
|       <scope>test</scope> | ||||
|     </dependency> | ||||
|     <dependency> | ||||
|       <groupId>log4j</groupId> | ||||
|       <artifactId>log4j</artifactId> | ||||
|     </dependency> | ||||
|   </dependencies> | ||||
|  | ||||
|   <build> | ||||
|  | ||||
|     <!--  | ||||
|     log4j.xml file will be copied both in ${project.build.outputDirectory}  | ||||
|     and ${project.build.outputDirectory}. Thanks to Sean Patrick Floyd  | ||||
|     (http://stackoverflow.com/questions/5637532/maven-how-to-place-resource-file-together-with-jar)  | ||||
|     --> | ||||
|        | ||||
|     <resources> | ||||
|       <resource> <!-- regular resource processing for everything except logback.xml --> | ||||
|         <directory>src/main/resources</directory> | ||||
|       </resource> | ||||
|       <resource> <!-- resource processing with a different output directory for log4j.xml --> | ||||
|         <directory>src/main/resources</directory> | ||||
|         <includes> | ||||
|           <include>log4j.xml</include> | ||||
|         </includes> | ||||
|         <targetPath>..</targetPath> <!-- relative to target/classes i.e. ${project.build.outputDirectory} --> | ||||
|       </resource> | ||||
|     </resources> | ||||
|  | ||||
|     <plugins> | ||||
|  | ||||
|       <!--  | ||||
|       This will exclude log4j.xml file from generated JAR  | ||||
|       --> | ||||
|       <plugin> | ||||
|         <groupId>org.apache.maven.plugins</groupId> | ||||
|         <artifactId>maven-jar-plugin</artifactId> | ||||
|         <version>2.6</version> | ||||
|         <configuration> | ||||
|           <excludes> | ||||
|             <exclude>log4j.xml</exclude> | ||||
|           </excludes> | ||||
|           <archive> | ||||
|             <manifest> | ||||
|               <addClasspath>true</addClasspath> | ||||
|             </manifest> | ||||
|           </archive> | ||||
|         </configuration> | ||||
|       </plugin> | ||||
|  | ||||
|     </plugins> | ||||
|   </build> | ||||
| </project> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user