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