Problems creating artifact(jar) resources not included in jar.

I'm trying to build an artifact using gradle and I am receiving an error "MANIFEST.MF already exists in VFS"  Also, when I can build the jar, it does not include the spring resources directory. It is related to "IDEA-132963 No spring resources after building artifact in IDEA 14"  and it was said it would be resolved in IDEA 14.1.  Do you have any clue, workaround to build executable jars, please?

INFO: Loading XML bean definitions from class path resource [spring/config/context.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/config/context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/config/context.xml] cannot be opened because it does not exist
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:251)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
        at edu.neu.AppAthletic.main(AppAthletic.java:22)
Caused by: java.io.FileNotFoundException: class path resource [spring/config/context.xml] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
        ... 13 more

1 comment
Comment actions Permalink

francisco.revelles wrote:

I'm trying to build an artifact using gradle and I am receiving an error "MANIFEST.MF already exists in VFS"  

this should be already fixed in the IDEA 14.1 EAP, please try the new build.

francisco.revelles wrote:

"IDEA-132963 No spring resources after building artifact in IDEA 14"  and it was said it would be resolved in IDEA 14.1.  Do you have any clue, workaround to build executable jars, please?

There were some fixes for resource handling in IDEA 14.1 but not all issues are fixed yet.
But, you could automate the workaround (invocation of a clean task) using new feature in IDEA 14.1.
Set 'Execute before make' for 'clean' task of the required project at the gradle toolwindow, see details at http://blog.jetbrains.com/idea/2015/03/new-features-for-gradle-coming-in-intellij-idea-14-1/

0

Please sign in to leave a comment.