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.war.stub;
20  
21  import java.io.File;
22  
23  /**
24   * Stub
25   */
26  public class WarArtifactStub extends AbstractArtifactStub {
27  
28      private String groupId;
29  
30      private String artifactId;
31  
32      private String classifier;
33  
34      private File file;
35  
36      public WarArtifactStub(String _basedir) {
37          super(_basedir);
38      }
39  
40      public String getType() {
41          return "war";
42      }
43  
44      public String getArtifactId() {
45          if (artifactId == null) {
46              return "simple";
47          } else {
48              return artifactId;
49          }
50      }
51  
52      public void setArtifactId(String _artifactId) {
53          artifactId = _artifactId;
54      }
55  
56      public String getGroupId() {
57          if (groupId == null) {
58              return "wartests";
59          } else {
60              return groupId;
61          }
62      }
63  
64      public void setGroupId(String groupId) {
65          this.groupId = groupId;
66      }
67  
68      public File getFile() {
69          if (file == null) {
70              return new File(basedir, "/target/test-classes/unit/sample_wars/simple.war");
71          } else {
72              return file;
73          }
74      }
75  
76      public void setFile(File _file) {
77          file = _file;
78      }
79  
80      public String getClassifier() {
81          return classifier;
82      }
83  
84      public void setClassifier(String classifier) {
85          this.classifier = classifier;
86      }
87  
88      public boolean hasClassifier() {
89          return classifier != null;
90      }
91  }