hi,Igor

Good day,thank you for your reply!follow your instruction " right click on the 
project, Maven, Use Maven
output folders." i cant find the option to choose output folder.But,i tried to 
change the path to the descriptor,then
it works.

my directory structure is like this:

src/main/java/BeanTest.java
src/main/resources/bean.xml

public class BeanTest
   {
            public static void main(String[] args)throws Exception
           {
             // ApplicationContext ctx = new 
FileSystemXmlApplicationContext("classpath:bean.xml"); //  success
      // ApplicationContext ctx = new 
FileSystemXmlApplicationContext("target/classes/bean.xml"); //  success 
                ApplicationContext ctx = new 
FileSystemXmlApplicationContext("bean.xml"); // fail,but in non-maven structure 
works
                TestBean t = (TestBean)ctx.getBean("test");
             ...
}
}

    how to use relative path like "bean.xml",maybe this is not a question about 
m2eclipse,but i hope you still can help me,the more 
you explain i will feel better!very appreciated!




oliver.m2eclipse
2008-05-06



发件人: Igor Fedorenko
发送时间: 2008-05-05 21:53:02
收件人: [email protected]
抄送: 
主题: Re: [m2eclipse-user] Simple question about locating the spring 
configdescriptor using m2eclipse?

Oliver,

By default, m2eclipse projects use separate output folders [1]. To use
Maven output folders, right click on the project, Maven, Use Maven
output folders. Let me know if you  still have problems running spring
applications from m2e.

[1] http://docs.codehaus.org/x/IoHFB

oliver.m2eclipse wrote:
> hi,all
>  
> I am newly to use the maven and m2eclipse . I have a test class that has 
> an void main method,i tried to load some bean in this method.
> but i encounter the the error like this:
>  
> Caused by: java.io.FileNotFoundException: bean.xml
>  
> my bean.xml is located in src/main/resoource/bean.xml,after i run mvn 
> resources:resources command bean.xml is moved to target/classes
> already.
>  
> so,i wonder how to config to run spring application by using m2eclipse??
>  
> appreciated for any help!!
>  
> ------------------------------------------------------------------------
> oliver.m2eclipse
> 2008-05-05


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to