1 Reply Latest reply on Aug 19, 2014 11:52 AM by jamezp

    log4j.properties does not work

    wuqian2huangchangsong

      Hi,

        I am coding in Eclipse with jdk1.8 and wildfly8.1.

      I deploy an ear project in wildfly8.1(without MATE-INF), then I want to add a log4j properties in it.

      So I copy MATE-INF to the ear that it is in wildfly directory deployment.

      and the ear directory struct is :

        +ear

        |-----lib

        |-----**.jar

        |-----**.war

        |------+MATE-INF (copy it from other directory )

               |----log4j.properties

      It work well.

       

      but I add the MATE-INF in project,and deploy it(create a new ear).

      my project directory deployment:

      +kd-acc

      |------JRE System Library

      |------Deployment Descript:

      |------+src

              |-----+main

                    |------+application

                           |-----+MATE-INF

                                 |-----log4j.properties

      |------gradle.buidle

       

      add my gradle.buidle:

      apply plugin: 'ear'
      apply plugin: 'eclipse-wtp'
      
      ear {
          baseName = 'kd-acc'
          deploymentDescriptor {
              version = 7
              applicationName = 'ihms'
              displayName = 'IHMS'
              description = 'Shenzhen Imagintech IHMS'
          }
      }
      
      eclipse {
          setJdtCompatibility(jdt)
      
          project {
              file {
                  beforeMerged { project ->
                      addGradleProjectSupport(project)
                  }
              }
          }
          classpath {
              file {
                  beforeMerged { classpath ->
                      //addGradleProjectClasspath(classpath)
                  }
                  whenMerged { classpath ->
                      //addJavaEEEarClasspath(classpath)
                      //addRuntimeClasspath(classpath)
                      classpath.entries.removeAll { entry->
                  entry.path == 'src/main/application'
              }
                  }
              }
          }
      
          wtp {
              facet {
                  facet name: 'jst.ear', version: '7.0'
              }
          }
      }
      
      dependencies {
          deploy project(':subprojects:allJpa')
      
          deploy project(':subprojects:embdLogic')
          deploy project(path: ':subprojects:embdWs', configuration: 'archives')
      
          deploy project(':subprojects:userLogic')
          deploy project(path: ':subprojects:userWs', configuration: 'archives')
          deploy project(path: ':subprojects:userWeb', configuration: 'archives')
      
          //deploy project(':subprojects:mngmntLogic')
          //deploy project(path: ':subprojects:mngmntWeb', configuration: 'archives')
      }
      dependencies {
          // compile dependency
          earlib 'commons-validator:commons-validator:1.+:@jar'
          earlib 'org.primefaces:primefaces:5.+:@jar'
          earlib 'com.github.axet:kaptcha:0.+:@jar'
      
          earlib project(':subprojects:common')
      }
      dependencies {
          // runtime dependency
          //earlib 'org.postgresql:postgresql:9.+:@jar'
          earlib 'com.jhlabs:filters:2.+:@jar'
      }
      
      

       

      It does not work, and the ear directory struct is not changed(like above struct).

      Any ideas.Thank you!