2012/10/26 Barrie Treloar <[email protected]>: > I've kind of asked this before for a different context: > http://maven.40175.n5.nabble.com/Maven-way-of-retrieving-URL-resources-so-that-settings-xml-proxy-is-used-td4908414.html > > I'm trying to run "mvn site" for the maven site project > https://svn.apache.org/repos/asf/maven/site/trunk and it fails: > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:3.1:site (default-site) on > project maven-site: Error during page generation: Error parsing > '...\site\src\site\apt\plugin-developers\cookbook\add-build-time-to-manifest.apt': > line [54] Unable to execute macro in the APT document: Error reading > snippet: Connection refused: connect -> [Help 1] > > And the reason is SnippetReader uses URL.openStream() to make the > connection, which doesn't know anything about the settings.xml and the > proxy defined there. > > And looking at the way I did this in m-e-p EclipsePlugin was to setup > the WagonManager component. > But that setup looks ugly and there should be an easier way to do this. > Since SnippetReader isn't a Maven plugin I'd have to inject > WagonManager in another way than @component. Maybe add an other constructor new SnippetReader( url, wagon ) with a new field for this wagon wagon is the implementation based on the url (file, http(s) etc..). instead of the simple BufferedReader reader = new BufferedReader( new InputStreamReader( source.openStream() ) );
test if wagon != null and use it if null use the same code as today. > > Does anyone have the magic sauce I am missing for this? > > And then my next step would be to ban raw usages of stuff like this in > the code base :) > But one step at a time. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
