You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by cs...@apache.org on 2012/05/15 10:21:08 UTC

svn commit: r1338595 - in /karaf/trunk/instance/core: pom.xml src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java

Author: cschneider
Date: Tue May 15 08:21:08 2012
New Revision: 1338595

URL: http://svn.apache.org/viewvc?rev=1338595&view=rev
Log:
KARAF-1206 Fixing pom so resources get copied into the jar again (seems to be a bug in maven bundle plugin). Improving exception when a file to be copied is not found

Modified:
    karaf/trunk/instance/core/pom.xml
    karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java

Modified: karaf/trunk/instance/core/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/instance/core/pom.xml?rev=1338595&r1=1338594&r2=1338595&view=diff
==============================================================================
--- karaf/trunk/instance/core/pom.xml (original)
+++ karaf/trunk/instance/core/pom.xml Tue May 15 08:21:08 2012
@@ -89,6 +89,12 @@
                     <include>**/*.info</include>
                 </includes>
             </resource>
+            <resource>
+                <directory>${project.build.directory}/generated-resources</directory>
+                <includes>
+                    <include>**/*.*</include>
+                </includes>
+            </resource>
         </resources>
         <plugins>
             <plugin>
@@ -102,7 +108,7 @@
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <outputDirectory>${project.build.outputDirectory}/org/apache/karaf/instance/</outputDirectory>
+                            <outputDirectory>${project.build.directory}/generated-resources/org/apache/karaf/instance/</outputDirectory>
                             <resources>
                                 <resource>
                                     <directory>${project.basedir}/../../assemblies/features/framework/src/main/resources</directory>

Modified: karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
URL: http://svn.apache.org/viewvc/karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java?rev=1338595&r1=1338594&r2=1338595&view=diff
==============================================================================
--- karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java (original)
+++ karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java Tue May 15 08:21:08 2012
@@ -406,9 +406,10 @@ public class InstanceServiceImpl impleme
                 println(Ansi.ansi().a("Creating file: ").a(Ansi.Attribute.INTENSITY_BOLD).a(outFile.getPath()).a(Ansi.Attribute.RESET).toString());
             }
 
-            InputStream is = getClass().getClassLoader().getResourceAsStream("org/apache/karaf/instance/resources/" + resource);
+            String sourcePath = "org/apache/karaf/instance/resources/" + resource;
+            InputStream is = getClass().getClassLoader().getResourceAsStream(sourcePath);
             if (is == null) {
-                throw new IOException("Unable to find resource " + resource);
+                throw new IOException("Unable to find resource " + sourcePath + " on classpath");
             }
             try {
                 if( text ) {