1 package org.apache.maven.plugins.pdf.stubs;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.io.FileReader;
24 import java.util.Collections;
25 import java.util.List;
26
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
29 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
30 import org.apache.maven.model.Model;
31 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
32 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
33
34
35
36
37
38 public class ITextMavenProjectStub
39 extends MavenProjectStub
40 {
41 public ITextMavenProjectStub()
42 {
43 MavenXpp3Reader pomReader = new MavenXpp3Reader();
44 try
45 {
46 Model model = pomReader.read( new FileReader( new File( getBasedir() + "/iText_pom.xml" ) ) );
47 setModel( model );
48 }
49 catch ( Exception e )
50 {
51 throw new RuntimeException( e );
52 }
53 }
54
55
56 public File getBasedir()
57 {
58 return new File( super.getBasedir() + "/target/test-classes/unit/pdf/" );
59 }
60
61
62 public List getRemoteArtifactRepositories()
63 {
64 ArtifactRepository repository =
65 new DefaultArtifactRepository( "central", "http://repo1.maven.org/maven2",
66 new DefaultRepositoryLayout() );
67
68 return Collections.singletonList( repository );
69 }
70 }