1   package org.apache.maven.plugin.javadoc.stubs;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
23  import org.apache.maven.model.Scm;
24  import org.apache.maven.model.Build;
25  import org.apache.maven.model.Model;
26  import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
27  
28  import java.util.List;
29  import java.util.ArrayList;
30  import java.io.FileReader;
31  import java.io.File;
32  
33  /**
34   * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
35   */
36  public class QuotedPathMavenProjectStub
37      extends MavenProjectStub
38  {
39     private Scm scm;
40  
41      private Build build;
42  
43      public QuotedPathMavenProjectStub()
44      {
45          setGroupId( "quotedpath.test" );
46          setArtifactId( "quotedpath-test" );
47          setVersion( "1.0-SNAPSHOT" );
48          setName( "Maven Javadoc Plugin Quoted Path Test" );
49          setUrl( "http://maven.apache.org" );
50          setPackaging( "jar" );
51  
52          Scm scm = new Scm();
53          scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
54          setScm( scm );
55  
56          Build build = new Build();
57          build.setFinalName( "quotedpath-test" );
58          build.setDirectory( getBasedir() + "/target/test/unit/quotedpath'test/target" );
59          setBuild( build );
60  
61          String basedir = getBasedir().getAbsolutePath();
62          List compileSourceRoots = new ArrayList();
63          compileSourceRoots.add( basedir + "/src/test/resources/unit/quotedpath'test/quotedpath/test" );
64          setCompileSourceRoots( compileSourceRoots );
65  
66          MavenXpp3Reader pomReader = new MavenXpp3Reader();
67  
68          try
69          {
70              Model model = pomReader.read( new FileReader( new File( getBasedir() +
71                  "/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml" ) ) );
72              setModel( model );
73          }
74          catch ( Exception e )
75          {
76  
77          }
78      }
79  
80      public Scm getScm()
81      {
82          return scm;
83      }
84  
85      public void setScm( Scm scm )
86      {
87          this.scm = scm;
88      }
89  
90      public Build getBuild()
91      {
92          return build;
93      }
94  
95      public void setBuild( Build build )
96      {
97          this.build = build;
98      }
99  
100 
101 }