}
public void testWrite_ShouldGenerateValidJavadocURLs()
throws MojoExecutionException, JDOMException, IOException
{
TestEclipseWriterConfig config = new TestEclipseWriterConfig();
File basedir = fileManager.createTempDir();
File repoDir = new File( basedir, "repo" );
config.setLocalRepository( new StubArtifactRepository( repoDir.getPath() ) );
config.setProjectBaseDir( basedir );
config.setEclipseProjectDirectory( basedir );
String baseOutputDir = "target/classes";
String maskedOutputDir = "target/classes/main-resources";
File buildOutputDir = new File( basedir, baseOutputDir );
buildOutputDir.mkdirs();
config.setBuildOutputDirectory( buildOutputDir );
new File( basedir, maskedOutputDir ).mkdirs();
config.setEclipseProjectName( "test-project" );
IdeDependency dependency = new IdeDependency();
dependency.setFile( new File( repoDir, "g/a/v/a-v.jar" ) );
dependency.setGroupId( "g" );
dependency.setArtifactId( "a" );
dependency.setVersion( "v" );
dependency.setAddedToClasspath( true );
dependency.setJavadocAttachment( new File( System.getProperty( "user.home" ), ".m2/some.jar" ) );
config.setDeps( new IdeDependency[] { dependency } );
TestLog log = new TestLog();
EclipseClasspathWriter classpathWriter = new EclipseClasspathWriter();
classpathWriter.init( log, config );