View Javadoc

1   package org.apache.maven.plugin.idea.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.model.Dependency;
23  import org.apache.maven.artifact.Artifact;
24  
25  import java.util.List;
26  import java.util.ArrayList;
27  
28  /**
29   * @author Edwin Punzalan
30   */
31  public class WarMavenProjectWithProvidedDependencyStub
32      extends WarMavenProjectStub
33  {
34      public List getTestArtifacts()
35      {
36          List testArtifacts = new ArrayList();
37  
38          Artifact artifact = createArtifact( "org.apache.maven", "maven-model", "2.0.1" );
39          artifact.setScope( Artifact.SCOPE_PROVIDED );
40          testArtifacts.add( artifact );
41  
42          Artifact artifact2 = createArtifact("javax.sql", "jdbc-stdext", "2.0");
43          artifact2.setScope( Artifact.SCOPE_SYSTEM );
44          testArtifacts.add( artifact2 );
45  
46          Artifact artifact3 = createArtifact("junit", "junit", "3.8.1");
47          artifact3.setScope( Artifact.SCOPE_TEST );
48          testArtifacts.add( artifact3 );
49  
50          return testArtifacts;
51      }
52  
53      public List getDependencies()
54      {
55          List dependencies = new ArrayList();
56  
57          Dependency dep = new Dependency();
58          dep.setGroupId( "org.apache.maven" );
59          dep.setArtifactId( "maven-model" );
60          dep.setVersion( "2.0.1" );
61          dep.setScope( Artifact.SCOPE_PROVIDED );
62          dependencies.add( dep );
63  
64          dep = new Dependency();
65          dep.setGroupId( "javax.sql" );
66          dep.setArtifactId( "jdbc-stdext" );
67          dep.setVersion( "2.0" );
68          dep.setScope( Artifact.SCOPE_SYSTEM );
69          dep.setSystemPath( "${java.home}/lib/rt.jar" );
70          dependencies.add( dep );
71  
72          dep = new Dependency();
73          dep.setGroupId( "junit" );
74          dep.setArtifactId( "junit" );
75          dep.setVersion( "3.8.1" );
76          dep.setScope( Artifact.SCOPE_TEST );
77          dependencies.add( dep );
78  
79          return dependencies;
80      }
81  }