Java Project: Failed to load ApplicationContext

后端 未结 3 1637
情深已故
情深已故 2020-12-28 12:55

I have a Java Project in which I am writing a simple JUNIT test case. I have copied the applicatinoContext.xml file into the root java source directory. I\'ve tried it wit

3条回答
  •  攒了一身酷
    2020-12-28 13:48

    I had the same problem, and I was using the following plugin for tests:

    
        org.apache.maven.plugins
        maven-surefire-plugin
        2.9
        
            true
            
                **/*Tests.java
                **/*Test.java
            
            
                **/Abstract*.java
            
            junit:junit
            methods
            10
        
    
    

    The test were running fine in the IDE (eclipse sts), but failed when using command mvn test.

    After a lot of trial and error, I figured the solution was to remove parallel testing, the following two lines from the plugin configuration above:

        methods
        10
    

    Hope that this helps someone out!

提交回复
热议问题