Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
3.0-alpha-5
-
None
-
None
Description
When a maven plugin tries to load a resource(file) from a plugin dependency defined in a project pom file and the path to that resource begins with 'slash' / then the resource is not found. The code uses the Plexus ResourceManagers
Example code that works in 2.2.1 and earlier and fails in Maven 3.0-alpha-5. If resource is in root of jar and configFile begins with forward slash then we get ResourceNotFoundException.
/** * ResourceManager for getting a resource from a dependency jar * * @component * @required * @readonly */ private ResourceManager locator; ... protected void loadResource(String configFile) throws ResourceNotFoundException { InputStream inStream = null; if (configFile != null) { try { inStream = locator.getResourceAsInputStream(configFile); } finally { if (inStream != null) { try { inStream.close(); } catch (IOException ex) { throw new RuntimeException( "Should not have happended", ex); } } } } }
Will attach IT test.
Attachments
Attachments
Issue Links
- is related to
-
MECLIPSE-631 [Maven 3] Integration test project-44 fails with Unable to resolve resource location: /checkstyle-config.xml
- Closed
- relates to
-
MNG-4813 org.jboss.maven.plugins:maven-jdocbook-plugin:2.1.1:generate fails with Maven 3.0-RC1
- Closed