KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > mavenplugins > geronimo > GeronimoMojoSupport


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
20 package org.apache.geronimo.mavenplugins.geronimo;
21
22 import org.apache.maven.project.MavenProject;
23 import org.apache.maven.artifact.repository.ArtifactRepository;
24
25 import org.apache.geronimo.genesis.ant.AntMojoSupport;
26
27 /**
28  * Support for Geronimo mojos.
29  *
30  * @version $Rev: 476061 $ $Date: 2006-11-17 01:36:50 -0500 (Fri, 17 Nov 2006) $
31  */

32 public abstract class GeronimoMojoSupport
33     extends AntMojoSupport
34 {
35     //
36
// NOTE: Not all mojos need Ant support, but due to the inability of Maven to inject custom components
37
// with their fields initalized we must use inheritence, see below.
38
//
39

40     //
41
// NOTE: These fields are used by all mojo's except for install, which does not need to
42
// connect to the server, but there is as of yet, no easy way to share common
43
// code in a Mavne plugin w/o inheritence, so for now these are duplicated for
44
// all mojos.
45
//
46

47     /**
48      * The hostname of the server to connect to.
49      *
50      * @parameter expression="${hostname}" default-value="localhost"
51      */

52     protected String JavaDoc hostname = null;
53
54     /**
55      * The port number to connect to the server.
56      *
57      * @parameter expression="${port}" default-value="1099"
58      */

59     protected int port = -1;
60
61     /**
62      * The username to authenticate with.
63      *
64      * @parameter expression="${username}" default-value="system"
65      */

66     protected String JavaDoc username = null;
67
68     /**
69      * The password to authenticate with.
70      *
71      * @parameter expression="${password}" default-value="manager"
72      */

73     protected String JavaDoc password = null;
74
75     //
76
// MojoSupport Hooks
77
//
78

79     /**
80      * The maven project.
81      *
82      * @parameter expression="${project}"
83      * @required
84      * @readonly
85      */

86     protected MavenProject project = null;
87
88     protected MavenProject getProject() {
89         return project;
90     }
91
92     /**
93      * ???
94      *
95      * @parameter expression="${localRepository}"
96      * @readonly
97      * @required
98      */

99     protected ArtifactRepository artifactRepository = null;
100
101     protected ArtifactRepository getArtifactRepository() {
102         return artifactRepository;
103     }
104 }
105
Popular Tags