Committed by
Gerrit Code Review
Adding archetype for onos-bundle and onos-cli projects.
Change-Id: I5df9db6a571be682ff2200c182bad8100dd95bfe
Showing
25 changed files
with
508 additions
and
178 deletions
... | @@ -72,6 +72,6 @@ echo $ONOS_VERSION > $ONOS_STAGE/VERSION | ... | @@ -72,6 +72,6 @@ echo $ONOS_VERSION > $ONOS_STAGE/VERSION |
72 | # Now package up the ONOS tar file | 72 | # Now package up the ONOS tar file |
73 | cd $ONOS_STAGE_ROOT | 73 | cd $ONOS_STAGE_ROOT |
74 | COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS | 74 | COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS |
75 | -which -a zip && zip -rq $ONOS_ZIP $ONOS_BITS | 75 | +which zip >/dev/null && zip -rq $ONOS_ZIP $ONOS_BITS |
76 | ls -l $ONOS_TAR $ONOS_ZIP >&2 | 76 | ls -l $ONOS_TAR $ONOS_ZIP >&2 |
77 | rm -r $ONOS_STAGE | 77 | rm -r $ONOS_STAGE | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | # ---------------------------------------------------------------------------- | 4 | # ---------------------------------------------------------------------------- |
5 | 5 | ||
6 | projects=$(find $ONOS_ROOT -name '*.java' \ | 6 | projects=$(find $ONOS_ROOT -name '*.java' \ |
7 | - -not -path '*/openflowj/*' -and -not -path '.git/*' \ | 7 | + -not -path '*/openflowj/*' -and -not -path '.git/*' -and -not -path '*/archetypes/*' \ |
8 | -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \ | 8 | -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \ |
9 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ | 9 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ |
10 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') | 10 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') | ... | ... |
tools/package/archetypes/api/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
18 | + <modelVersion>4.0.0</modelVersion> | ||
19 | + | ||
20 | + <parent> | ||
21 | + <groupId>org.onosproject</groupId> | ||
22 | + <artifactId>onos-archetypes</artifactId> | ||
23 | + <version>1.0.0-SNAPSHOT</version> | ||
24 | + </parent> | ||
25 | + | ||
26 | + <artifactId>onos-api-archetype</artifactId> | ||
27 | + <packaging>maven-archetype</packaging> | ||
28 | + | ||
29 | + <description>ONOS OSGi API bundle archetype</description> | ||
30 | + | ||
31 | +</project> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="onos-bundle" | ||
18 | + xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" | ||
19 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
20 | + <fileSets> | ||
21 | + <fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
22 | + <directory>src/main/java</directory> | ||
23 | + <includes> | ||
24 | + <include>**/*.java</include> | ||
25 | + </includes> | ||
26 | + </fileSet> | ||
27 | + </fileSets> | ||
28 | +</archetype-descriptor> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
18 | + <modelVersion>4.0.0</modelVersion> | ||
19 | + | ||
20 | + <groupId>${groupId}</groupId> | ||
21 | + <artifactId>${artifactId}</artifactId> | ||
22 | + <version>${version}</version> | ||
23 | + <packaging>bundle</packaging> | ||
24 | + | ||
25 | + <description>ONOS OSGi API bundle archetype</description> | ||
26 | + <url>http://onosproject.org</url> | ||
27 | + | ||
28 | + <properties> | ||
29 | + <onos.version>1.0.0-SNAPSHOT</onos.version> | ||
30 | + </properties> | ||
31 | + | ||
32 | + <dependencies> | ||
33 | + <dependency> | ||
34 | + <groupId>org.onosproject</groupId> | ||
35 | + <artifactId>onos-api</artifactId> | ||
36 | + <version>${onos.version}</version> | ||
37 | + </dependency> | ||
38 | + </dependencies> | ||
39 | + | ||
40 | + <build> | ||
41 | + <plugins> | ||
42 | + <plugin> | ||
43 | + <groupId>org.apache.felix</groupId> | ||
44 | + <artifactId>maven-bundle-plugin</artifactId> | ||
45 | + <version>2.5.3</version> | ||
46 | + <extensions>true</extensions> | ||
47 | + </plugin> | ||
48 | + </plugins> | ||
49 | + </build> | ||
50 | + | ||
51 | +</project> |
1 | +#set( $symbol_pound = '#' ) | ||
2 | +#set( $symbol_dollar = '$' ) | ||
3 | +#set( $symbol_escape = '\' ) | ||
1 | /* | 4 | /* |
2 | * Copyright 2014 Open Networking Laboratory | 5 | * Copyright 2014 Open Networking Laboratory |
3 | * | 6 | * |
... | @@ -13,7 +16,7 @@ | ... | @@ -13,7 +16,7 @@ |
13 | * See the License for the specific language governing permissions and | 16 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 17 | * limitations under the License. |
15 | */ | 18 | */ |
16 | -package sample.bundle; | 19 | +package ${package}; |
17 | 20 | ||
18 | /** | 21 | /** |
19 | * Skeletal ONOS application API. | 22 | * Skeletal ONOS application API. | ... | ... |
File mode changed
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | -<!-- | 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
3 | - ~ Copyright 2014 Open Networking Laboratory | 3 | + <modelVersion>4.0.0</modelVersion> |
4 | - ~ | ||
5 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - ~ you may not use this file except in compliance with the License. | ||
7 | - ~ You may obtain a copy of the License at | ||
8 | - ~ | ||
9 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - ~ | ||
11 | - ~ Unless required by applicable law or agreed to in writing, software | ||
12 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - ~ See the License for the specific language governing permissions and | ||
15 | - ~ limitations under the License. | ||
16 | - --> | ||
17 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
18 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
19 | - <modelVersion>4.0.0</modelVersion> | ||
20 | 4 | ||
5 | + <parent> | ||
21 | <groupId>org.onosproject</groupId> | 6 | <groupId>org.onosproject</groupId> |
22 | - <artifactId>onos-bundle</artifactId> | 7 | + <artifactId>onos-archetypes</artifactId> |
23 | <version>1.0.0-SNAPSHOT</version> | 8 | <version>1.0.0-SNAPSHOT</version> |
24 | - <packaging>bundle</packaging> | 9 | + </parent> |
25 | 10 | ||
26 | - <description>ONOS OSGi bundle archetype</description> | 11 | + <artifactId>onos-bundle-archetype</artifactId> |
27 | - <url>http://onosproject.org</url> | 12 | + <packaging>maven-archetype</packaging> |
28 | 13 | ||
29 | - <properties> | 14 | + <description>ONOS OSGi bundle archetype</description> |
30 | - <onos.version>1.0.0-SNAPSHOT</onos.version> | ||
31 | - </properties> | ||
32 | - | ||
33 | - <dependencies> | ||
34 | - <dependency> | ||
35 | - <groupId>org.onosproject</groupId> | ||
36 | - <artifactId>onos-api</artifactId> | ||
37 | - <version>${onos.version}</version> | ||
38 | - </dependency> | ||
39 | - | ||
40 | - <dependency> | ||
41 | - <groupId>org.onosproject</groupId> | ||
42 | - <artifactId>onlab-osgi</artifactId> | ||
43 | - <version>${onos.version}</version> | ||
44 | - </dependency> | ||
45 | - | ||
46 | - <dependency> | ||
47 | - <groupId>org.apache.felix</groupId> | ||
48 | - <artifactId>org.apache.felix.scr.annotations</artifactId> | ||
49 | - <version>1.9.8</version> | ||
50 | - <scope>provided</scope> | ||
51 | - </dependency> | ||
52 | - | ||
53 | - <dependency> | ||
54 | - <groupId>junit</groupId> | ||
55 | - <artifactId>junit</artifactId> | ||
56 | - <version>4.11</version> | ||
57 | - <scope>test</scope> | ||
58 | - </dependency> | ||
59 | - | ||
60 | - <dependency> | ||
61 | - <groupId>org.onosproject</groupId> | ||
62 | - <artifactId>onos-api</artifactId> | ||
63 | - <version>${onos.version}</version> | ||
64 | - <scope>test</scope> | ||
65 | - <classifier>tests</classifier> | ||
66 | - </dependency> | ||
67 | - </dependencies> | ||
68 | - | ||
69 | - <build> | ||
70 | - <plugins> | ||
71 | - <plugin> | ||
72 | - <groupId>org.apache.felix</groupId> | ||
73 | - <artifactId>maven-bundle-plugin</artifactId> | ||
74 | - <version>2.5.3</version> | ||
75 | - <extensions>true</extensions> | ||
76 | - </plugin> | ||
77 | - | ||
78 | - <plugin> | ||
79 | - <groupId>org.apache.felix</groupId> | ||
80 | - <artifactId>maven-scr-plugin</artifactId> | ||
81 | - <version>1.20.0</version> | ||
82 | - <executions> | ||
83 | - <execution> | ||
84 | - <id>generate-scr-srcdescriptor</id> | ||
85 | - <goals> | ||
86 | - <goal>scr</goal> | ||
87 | - </goals> | ||
88 | - </execution> | ||
89 | - </executions> | ||
90 | - <configuration> | ||
91 | - <supportedProjectTypes> | ||
92 | - <supportedProjectType>bundle</supportedProjectType> | ||
93 | - <supportedProjectType>war</supportedProjectType> | ||
94 | - </supportedProjectTypes> | ||
95 | - </configuration> | ||
96 | - </plugin> | ||
97 | - </plugins> | ||
98 | - </build> | ||
99 | 15 | ||
100 | </project> | 16 | </project> | ... | ... |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="onos-bundle" | ||
3 | + xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" | ||
4 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
5 | + <fileSets> | ||
6 | + <fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
7 | + <directory>src/main/java</directory> | ||
8 | + <includes> | ||
9 | + <include>**/*.java</include> | ||
10 | + </includes> | ||
11 | + </fileSet> | ||
12 | + <fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
13 | + <directory>src/test/java</directory> | ||
14 | + <includes> | ||
15 | + <include>**/*.java</include> | ||
16 | + </includes> | ||
17 | + </fileSet> | ||
18 | + </fileSets> | ||
19 | +</archetype-descriptor> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
18 | + <modelVersion>4.0.0</modelVersion> | ||
19 | + | ||
20 | + <groupId>${groupId}</groupId> | ||
21 | + <artifactId>${artifactId}</artifactId> | ||
22 | + <version>${version}</version> | ||
23 | + <packaging>bundle</packaging> | ||
24 | + | ||
25 | + <description>ONOS OSGi bundle archetype</description> | ||
26 | + <url>http://onosproject.org</url> | ||
27 | + | ||
28 | + <properties> | ||
29 | + <onos.version>1.0.0-SNAPSHOT</onos.version> | ||
30 | + </properties> | ||
31 | + | ||
32 | + <dependencies> | ||
33 | + <dependency> | ||
34 | + <groupId>org.onosproject</groupId> | ||
35 | + <artifactId>onos-api</artifactId> | ||
36 | + <version>${onos.version}</version> | ||
37 | + </dependency> | ||
38 | + | ||
39 | + <dependency> | ||
40 | + <groupId>org.onosproject</groupId> | ||
41 | + <artifactId>onlab-osgi</artifactId> | ||
42 | + <version>${onos.version}</version> | ||
43 | + </dependency> | ||
44 | + | ||
45 | + <dependency> | ||
46 | + <groupId>junit</groupId> | ||
47 | + <artifactId>junit</artifactId> | ||
48 | + <version>4.11</version> | ||
49 | + <scope>test</scope> | ||
50 | + </dependency> | ||
51 | + | ||
52 | + <dependency> | ||
53 | + <groupId>org.onosproject</groupId> | ||
54 | + <artifactId>onos-api</artifactId> | ||
55 | + <version>${onos.version}</version> | ||
56 | + <scope>test</scope> | ||
57 | + <classifier>tests</classifier> | ||
58 | + </dependency> | ||
59 | + | ||
60 | + <dependency> | ||
61 | + <groupId>org.apache.felix</groupId> | ||
62 | + <artifactId>org.apache.felix.scr.annotations</artifactId> | ||
63 | + <version>1.9.8</version> | ||
64 | + <scope>provided</scope> | ||
65 | + </dependency> | ||
66 | + </dependencies> | ||
67 | + | ||
68 | + <build> | ||
69 | + <plugins> | ||
70 | + <plugin> | ||
71 | + <groupId>org.apache.felix</groupId> | ||
72 | + <artifactId>maven-bundle-plugin</artifactId> | ||
73 | + <version>2.5.3</version> | ||
74 | + <extensions>true</extensions> | ||
75 | + </plugin> | ||
76 | + | ||
77 | + <plugin> | ||
78 | + <groupId>org.apache.felix</groupId> | ||
79 | + <artifactId>maven-scr-plugin</artifactId> | ||
80 | + <version>1.20.0</version> | ||
81 | + <executions> | ||
82 | + <execution> | ||
83 | + <id>generate-scr-srcdescriptor</id> | ||
84 | + <goals> | ||
85 | + <goal>scr</goal> | ||
86 | + </goals> | ||
87 | + </execution> | ||
88 | + </executions> | ||
89 | + <configuration> | ||
90 | + <supportedProjectTypes> | ||
91 | + <supportedProjectType>bundle</supportedProjectType> | ||
92 | + <supportedProjectType>war</supportedProjectType> | ||
93 | + </supportedProjectTypes> | ||
94 | + </configuration> | ||
95 | + </plugin> | ||
96 | + </plugins> | ||
97 | + </build> | ||
98 | + | ||
99 | +</project> |
1 | +#set( $symbol_pound = '#' ) | ||
2 | +#set( $symbol_dollar = '$' ) | ||
3 | +#set( $symbol_escape = '\' ) | ||
1 | /* | 4 | /* |
2 | * Copyright 2014 Open Networking Laboratory | 5 | * Copyright 2014 Open Networking Laboratory |
3 | * | 6 | * |
... | @@ -13,7 +16,7 @@ | ... | @@ -13,7 +16,7 @@ |
13 | * See the License for the specific language governing permissions and | 16 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 17 | * limitations under the License. |
15 | */ | 18 | */ |
16 | -package sample.bundle; | 19 | +package ${package}; |
17 | 20 | ||
18 | import org.apache.felix.scr.annotations.Activate; | 21 | import org.apache.felix.scr.annotations.Activate; |
19 | import org.apache.felix.scr.annotations.Component; | 22 | import org.apache.felix.scr.annotations.Component; |
... | @@ -26,8 +29,7 @@ import org.slf4j.LoggerFactory; | ... | @@ -26,8 +29,7 @@ import org.slf4j.LoggerFactory; |
26 | * Skeletal ONOS application component. | 29 | * Skeletal ONOS application component. |
27 | */ | 30 | */ |
28 | @Component(immediate = true) | 31 | @Component(immediate = true) |
29 | -@Service | 32 | +public class AppComponent { |
30 | -public class AppComponent implements AppService { | ||
31 | 33 | ||
32 | private static Logger log = LoggerFactory.getLogger(AppComponent.class); | 34 | private static Logger log = LoggerFactory.getLogger(AppComponent.class); |
33 | 35 | ... | ... |
1 | +#set( $symbol_pound = '#' ) | ||
2 | +#set( $symbol_dollar = '$' ) | ||
3 | +#set( $symbol_escape = '\' ) | ||
1 | /* | 4 | /* |
2 | * Copyright 2014 Open Networking Laboratory | 5 | * Copyright 2014 Open Networking Laboratory |
3 | * | 6 | * |
... | @@ -13,7 +16,7 @@ | ... | @@ -13,7 +16,7 @@ |
13 | * See the License for the specific language governing permissions and | 16 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 17 | * limitations under the License. |
15 | */ | 18 | */ |
16 | -package sample.bundle; | 19 | +package ${package}; |
17 | 20 | ||
18 | import org.junit.After; | 21 | import org.junit.After; |
19 | import org.junit.Before; | 22 | import org.junit.Before; | ... | ... |
File mode changed
tools/package/archetypes/cli/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
18 | + <modelVersion>4.0.0</modelVersion> | ||
19 | + | ||
20 | + <parent> | ||
21 | + <groupId>org.onosproject</groupId> | ||
22 | + <artifactId>onos-archetypes</artifactId> | ||
23 | + <version>1.0.0-SNAPSHOT</version> | ||
24 | + </parent> | ||
25 | + | ||
26 | + <artifactId>onos-cli-archetype</artifactId> | ||
27 | + <packaging>maven-archetype</packaging> | ||
28 | + | ||
29 | + <name>onos-cli-archetype</name> | ||
30 | + <description>ONOS Apache Karaf bundle archetype</description> | ||
31 | + | ||
32 | +</project> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="onos-bundle" | ||
18 | + xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" | ||
19 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
20 | + <fileSets> | ||
21 | + <fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
22 | + <directory>src/main/java</directory> | ||
23 | + <includes> | ||
24 | + <include>**/*.java</include> | ||
25 | + </includes> | ||
26 | + </fileSet> | ||
27 | + <fileSet filtered="true" packaged="false" encoding="UTF-8"> | ||
28 | + <directory>src/main/resources</directory> | ||
29 | + <includes> | ||
30 | + <include>**/*.xml</include> | ||
31 | + </includes> | ||
32 | + </fileSet> | ||
33 | + </fileSets> | ||
34 | +</archetype-descriptor> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
1 | <!-- | 2 | <!-- |
2 | ~ Copyright 2014 Open Networking Laboratory | 3 | ~ Copyright 2014 Open Networking Laboratory |
3 | ~ | 4 | ~ |
... | @@ -13,26 +14,19 @@ | ... | @@ -13,26 +14,19 @@ |
13 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
14 | ~ limitations under the License. | 15 | ~ limitations under the License. |
15 | --> | 16 | --> |
16 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | 17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
17 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
18 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
19 | <modelVersion>4.0.0</modelVersion> | 18 | <modelVersion>4.0.0</modelVersion> |
20 | 19 | ||
21 | - <groupId>org.onosproject</groupId> | 20 | + <groupId>${groupId}</groupId> |
22 | - <artifactId>onos-web-bundle</artifactId> | 21 | + <artifactId>${artifactId}</artifactId> |
23 | - <version>1.0.0-SNAPSHOT</version> | 22 | + <version>${version}</version> |
24 | <packaging>bundle</packaging> | 23 | <packaging>bundle</packaging> |
25 | 24 | ||
26 | - <description>ONOS OSGi web bundle archetype</description> | 25 | + <description>ONOS OSGi bundle archetype</description> |
27 | <url>http://onosproject.org</url> | 26 | <url>http://onosproject.org</url> |
28 | 27 | ||
29 | <properties> | 28 | <properties> |
30 | <onos.version>1.0.0-SNAPSHOT</onos.version> | 29 | <onos.version>1.0.0-SNAPSHOT</onos.version> |
31 | - <jersey.version>1.18.1</jersey.version> | ||
32 | - <jackson.version>2.4.2</jackson.version> | ||
33 | - <guava.version>18.0</guava.version> | ||
34 | - | ||
35 | - <web.context>sample</web.context> | ||
36 | </properties> | 30 | </properties> |
37 | 31 | ||
38 | <dependencies> | 32 | <dependencies> |
... | @@ -49,52 +43,25 @@ | ... | @@ -49,52 +43,25 @@ |
49 | </dependency> | 43 | </dependency> |
50 | 44 | ||
51 | <dependency> | 45 | <dependency> |
52 | - <groupId>org.onosproject</groupId> | 46 | + <groupId>junit</groupId> |
53 | - <artifactId>onlab-rest</artifactId> | 47 | + <artifactId>junit</artifactId> |
54 | - <version>${onos.version}</version> | 48 | + <version>4.11</version> |
55 | - </dependency> | ||
56 | - <dependency> | ||
57 | - <groupId>org.onosproject</groupId> | ||
58 | - <artifactId>onlab-junit</artifactId> | ||
59 | - <version>${onos.version}</version> | ||
60 | <scope>test</scope> | 49 | <scope>test</scope> |
61 | </dependency> | 50 | </dependency> |
62 | 51 | ||
63 | <dependency> | 52 | <dependency> |
64 | - <groupId>com.google.guava</groupId> | 53 | + <groupId>org.onosproject</groupId> |
65 | - <artifactId>guava</artifactId> | 54 | + <artifactId>onos-cli</artifactId> |
66 | - <version>${guava.version}</version> | 55 | + <version>${onos.version}</version> |
56 | + <scope>provided</scope> | ||
67 | </dependency> | 57 | </dependency> |
68 | 58 | ||
69 | <dependency> | 59 | <dependency> |
70 | - <groupId>com.sun.jersey</groupId> | 60 | + <groupId>org.onosproject</groupId> |
71 | - <artifactId>jersey-servlet</artifactId> | 61 | + <artifactId>onos-api</artifactId> |
72 | - <version>${jersey.version}</version> | 62 | + <version>${onos.version}</version> |
73 | - </dependency> | ||
74 | - <dependency> | ||
75 | - <groupId>com.sun.jersey.jersey-test-framework</groupId> | ||
76 | - <artifactId>jersey-test-framework-core</artifactId> | ||
77 | - <version>${jersey.version}</version> | ||
78 | - <scope>test</scope> | ||
79 | - </dependency> | ||
80 | - <dependency> | ||
81 | - <groupId>com.sun.jersey.jersey-test-framework</groupId> | ||
82 | - <artifactId>jersey-test-framework-grizzly2</artifactId> | ||
83 | - <version>${jersey.version}</version> | ||
84 | <scope>test</scope> | 63 | <scope>test</scope> |
85 | - </dependency> | 64 | + <classifier>tests</classifier> |
86 | - | ||
87 | - <dependency> | ||
88 | - <groupId>com.fasterxml.jackson.core</groupId> | ||
89 | - <artifactId>jackson-databind</artifactId> | ||
90 | - <version>${jackson.version}</version> | ||
91 | - <scope>provided</scope> | ||
92 | - </dependency> | ||
93 | - <dependency> | ||
94 | - <groupId>com.fasterxml.jackson.core</groupId> | ||
95 | - <artifactId>jackson-annotations</artifactId> | ||
96 | - <version>${jackson.version}</version> | ||
97 | - <scope>provided</scope> | ||
98 | </dependency> | 65 | </dependency> |
99 | 66 | ||
100 | <dependency> | 67 | <dependency> |
... | @@ -109,41 +76,40 @@ | ... | @@ -109,41 +76,40 @@ |
109 | <version>1.9.8</version> | 76 | <version>1.9.8</version> |
110 | <scope>provided</scope> | 77 | <scope>provided</scope> |
111 | </dependency> | 78 | </dependency> |
79 | + <dependency> | ||
80 | + <groupId>org.apache.karaf.shell</groupId> | ||
81 | + <artifactId>org.apache.karaf.shell.console</artifactId> | ||
82 | + <version>3.0.2</version> | ||
83 | + <scope>provided</scope> | ||
84 | + </dependency> | ||
112 | </dependencies> | 85 | </dependencies> |
113 | 86 | ||
114 | <build> | 87 | <build> |
115 | <plugins> | 88 | <plugins> |
116 | <plugin> | 89 | <plugin> |
117 | <groupId>org.apache.felix</groupId> | 90 | <groupId>org.apache.felix</groupId> |
118 | - <artifactId>maven-scr-plugin</artifactId> | 91 | + <artifactId>maven-bundle-plugin</artifactId> |
92 | + <version>2.5.3</version> | ||
93 | + <extensions>true</extensions> | ||
119 | </plugin> | 94 | </plugin> |
95 | + | ||
120 | <plugin> | 96 | <plugin> |
121 | <groupId>org.apache.felix</groupId> | 97 | <groupId>org.apache.felix</groupId> |
122 | - <artifactId>maven-bundle-plugin</artifactId> | 98 | + <artifactId>maven-scr-plugin</artifactId> |
123 | - <extensions>true</extensions> | 99 | + <version>1.20.0</version> |
100 | + <executions> | ||
101 | + <execution> | ||
102 | + <id>generate-scr-srcdescriptor</id> | ||
103 | + <goals> | ||
104 | + <goal>scr</goal> | ||
105 | + </goals> | ||
106 | + </execution> | ||
107 | + </executions> | ||
124 | <configuration> | 108 | <configuration> |
125 | - <instructions> | 109 | + <supportedProjectTypes> |
126 | - <_wab>src/main/webapp/</_wab> | 110 | + <supportedProjectType>bundle</supportedProjectType> |
127 | - <Bundle-SymbolicName> | 111 | + <supportedProjectType>war</supportedProjectType> |
128 | - ${project.groupId}.${project.artifactId} | 112 | + </supportedProjectTypes> |
129 | - </Bundle-SymbolicName> | ||
130 | - <Import-Package> | ||
131 | - org.slf4j, | ||
132 | - org.osgi.framework, | ||
133 | - javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext, | ||
134 | - com.sun.jersey.api.core, | ||
135 | - com.sun.jersey.spi.container.servlet, | ||
136 | - com.sun.jersey.server.impl.container.servlet, | ||
137 | - com.fasterxml.jackson.databind, | ||
138 | - com.fasterxml.jackson.databind.node, | ||
139 | - org.onlab.util.*, | ||
140 | - org.onlab.osgi.*, | ||
141 | - org.onlab.packet.*, | ||
142 | - org.onlab.rest.*, | ||
143 | - org.onosproject.* | ||
144 | - </Import-Package> | ||
145 | - <Web-ContextPath>${web.context}</Web-ContextPath> | ||
146 | - </instructions> | ||
147 | </configuration> | 113 | </configuration> |
148 | </plugin> | 114 | </plugin> |
149 | </plugins> | 115 | </plugins> | ... | ... |
tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2014 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | +package ${package}; | ||
17 | + | ||
18 | +import org.apache.karaf.shell.commands.Command; | ||
19 | +import org.onosproject.cli.AbstractShellCommand; | ||
20 | + | ||
21 | +/** | ||
22 | + * Sample Apache Karaf CLI command | ||
23 | + */ | ||
24 | +@Command(scope = "onos", name = "sample", | ||
25 | + description = "Sample Apache Karaf CLI command") | ||
26 | +public class AppCommand extends AbstractShellCommand { | ||
27 | + | ||
28 | + @Override | ||
29 | + protected void execute() { | ||
30 | + print("Hello %s", "World"); | ||
31 | + } | ||
32 | + | ||
33 | +} |
1 | +<!-- | ||
2 | + ~ Copyright 2014 Open Networking Laboratory | ||
3 | + ~ | ||
4 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + ~ you may not use this file except in compliance with the License. | ||
6 | + ~ You may obtain a copy of the License at | ||
7 | + ~ | ||
8 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + ~ | ||
10 | + ~ Unless required by applicable law or agreed to in writing, software | ||
11 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + ~ See the License for the specific language governing permissions and | ||
14 | + ~ limitations under the License. | ||
15 | + --> | ||
16 | +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> | ||
17 | + | ||
18 | + <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> | ||
19 | + <command> | ||
20 | + <action class="${package}.AppCommand"/> | ||
21 | + </command> | ||
22 | + </command-bundle> | ||
23 | + | ||
24 | +</blueprint> |
File mode changed
... | @@ -21,18 +21,40 @@ | ... | @@ -21,18 +21,40 @@ |
21 | 21 | ||
22 | <parent> | 22 | <parent> |
23 | <groupId>org.onosproject</groupId> | 23 | <groupId>org.onosproject</groupId> |
24 | - <artifactId>onos</artifactId> | 24 | + <artifactId>onos-base</artifactId> |
25 | - <version>1.0.0-SNAPSHOT</version> | 25 | + <version>1</version> |
26 | - <relativePath>../../../pom.xml</relativePath> | 26 | + <relativePath>../../build/pom.xml</relativePath> |
27 | </parent> | 27 | </parent> |
28 | 28 | ||
29 | <artifactId>onos-archetypes</artifactId> | 29 | <artifactId>onos-archetypes</artifactId> |
30 | + <version>1.0.0-SNAPSHOT</version> | ||
30 | <packaging>pom</packaging> | 31 | <packaging>pom</packaging> |
31 | 32 | ||
32 | - <description>ONOS Maven archetype projects</description> | 33 | + <description>ONOS archetypes project</description> |
33 | 34 | ||
34 | <modules> | 35 | <modules> |
36 | + <module>api</module> | ||
35 | <module>bundle</module> | 37 | <module>bundle</module> |
38 | + <module>cli</module> | ||
36 | </modules> | 39 | </modules> |
37 | 40 | ||
41 | + <build> | ||
42 | + <extensions> | ||
43 | + <extension> | ||
44 | + <groupId>org.apache.maven.archetype</groupId> | ||
45 | + <artifactId>archetype-packaging</artifactId> | ||
46 | + <version>2.2</version> | ||
47 | + </extension> | ||
48 | + </extensions> | ||
49 | + | ||
50 | + <pluginManagement> | ||
51 | + <plugins> | ||
52 | + <plugin> | ||
53 | + <artifactId>maven-archetype-plugin</artifactId> | ||
54 | + <version>2.2</version> | ||
55 | + </plugin> | ||
56 | + </plugins> | ||
57 | + </pluginManagement> | ||
58 | + </build> | ||
59 | + | ||
38 | </project> | 60 | </project> | ... | ... |
tools/package/etc/users.properties
0 → 100644
1 | +################################################################################ | ||
2 | +# | ||
3 | +# Licensed to the Apache Software Foundation (ASF) under one or more | ||
4 | +# contributor license agreements. See the NOTICE file distributed with | ||
5 | +# this work for additional information regarding copyright ownership. | ||
6 | +# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
7 | +# (the "License"); you may not use this file except in compliance with | ||
8 | +# 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, software | ||
13 | +# distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | +# See the License for the specific language governing permissions and | ||
16 | +# limitations under the License. | ||
17 | +# | ||
18 | +################################################################################ | ||
19 | + | ||
20 | +# | ||
21 | +# This file contains the users, groups, and roles. | ||
22 | +# Each line has to be of the format: | ||
23 | +# | ||
24 | +# USER=PASSWORD,ROLE1,ROLE2,... | ||
25 | +# USER=PASSWORD,_g_:GROUP,... | ||
26 | +# _g_\:GROUP=ROLE1,ROLE2,... | ||
27 | +# | ||
28 | +# All users, grousp, and roles entered in this file are available after Karaf startup | ||
29 | +# and modifiable via the JAAS command group. These users reside in a JAAS domain | ||
30 | +# with the name "karaf". | ||
31 | +# | ||
32 | +karaf = karaf,_g_:admingroup | ||
33 | +onos = onos,_g_:admingroup | ||
34 | +_g_\:admingroup = group,admin,manager,viewer,webconsole |
tools/test/bin/onos-archetypes-test
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Builds a set of projects using ONOS archetypes. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +export AROOT=/tmp/foo | ||
7 | +export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -Dversion=1.0.0-SNAPSHOT" | ||
8 | + | ||
9 | +for an in api bundle cli; do | ||
10 | + cd $AROOT | ||
11 | + rm -fr $AROOT/foo-$an | ||
12 | + mvn archetype:generate $ARCHETYPE_OPTS \ | ||
13 | + -DarchetypeArtifactId=onos-$an-archetype \ | ||
14 | + -DgroupId=org.foo -DartifactId=foo-$an -Dversion=1.0 \ | ||
15 | + -Dpackage=org.foo.$an -DinteractiveMode=false | ||
16 | + cd $AROOT/foo-$an | ||
17 | + mvn clean install | ||
18 | +done |
-
Please register or login to post a comment