Skip to content

Commit 5a24294

Browse files
committed
Some improvements on deployment, but not yet working, some issue with double registration of the component, not sure why.
1 parent 8ad039b commit 5a24294

File tree

7 files changed

+90
-40
lines changed

7 files changed

+90
-40
lines changed

.gitignore

+2-8
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,5 @@ jspm_packages
3636
# Optional REPL history
3737
.node_repl_history
3838
.idea/
39-
contextserver-graphql-api.iml
40-
java/cxs-graphql-api-root.iml
41-
java/bundles/cxs-graphql-api-bundles.iml
42-
java/bundles/target/
43-
java/features/cxs-graphql-api-features.iml
44-
java/features/target/
45-
java/package/cxs-graphql-api-package.iml
46-
java/package/target/
39+
target/
40+
*.iml

java/buildAndRun.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
mvn clean install
3+
pushd package/target
4+
tar zxvf cxs-graphql-api-package-1.0-SNAPSHOT.tar.gz
5+
cd cxs-graphql-api-package-1.0-SNAPSHOT/bin
6+
./karaf debug
7+
popd

java/bundles/graphql-impl/pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@
1717
<groupId>com.graphql-java</groupId>
1818
<artifactId>graphql-java-servlet</artifactId>
1919
<version>2.1.0</version>
20+
<scope>provided</scope>
2021
</dependency>
2122
<dependency>
2223
<groupId>com.graphql-java</groupId>
2324
<artifactId>graphql-java</artifactId>
2425
<version>2.2.0</version>
26+
<scope>provided</scope>
2527
</dependency>
2628
<dependency>
2729
<groupId>org.osgi</groupId>
2830
<artifactId>osgi.enterprise</artifactId>
2931
<version>6.0.0</version>
32+
<scope>provided</scope>
3033
</dependency>
3134
<dependency>
3235
<groupId>org.apache.felix</groupId>

java/bundles/graphql-impl/src/main/java/org/oasis_open/contextserver/graphql/CXSGraphQLProvider.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package org.oasis_open.contextserver.graphql;
22

3-
import org.osgi.service.component.annotations.Activate;
43
import org.osgi.service.component.annotations.Component;
5-
import org.osgi.service.component.annotations.Reference;
6-
import org.osgi.service.component.annotations.ReferenceCardinality;
7-
import org.osgi.service.component.annotations.ReferencePolicy;
84

95
import graphql.schema.GraphQLFieldDefinition;
106
import graphql.schema.GraphQLObjectType;
@@ -28,17 +24,24 @@
2824
@Component(
2925
name="CXSGraphQLProvider"
3026
)
31-
public class CXSGraphQLProvider implements GraphQLQueryProvider, GraphQLMutationProvider, GraphQLTypesProvider {
27+
public class CXSGraphQLProvider implements GraphQLQueryProvider, GraphQLTypesProvider {
3228
public GraphQLObjectType getQuery() {
33-
return null;
29+
GraphQLObjectType queryType = newObject()
30+
.name("helloWorldQuery")
31+
.field(newFieldDefinition()
32+
.type(GraphQLString)
33+
.name("hello")
34+
.staticValue("world"))
35+
.build();
36+
return queryType;
3437
}
3538

3639
public Object context() {
3740
return null;
3841
}
3942

4043
public String getName() {
41-
return null;
44+
return "CXSGraphQLProvider";
4245
}
4346

4447
public Collection<GraphQLFieldDefinition> getMutations() {

java/features/pom.xml

+53-3
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,73 @@
1313
<artifactId>cxs-graphql-api-features</artifactId>
1414

1515
<dependencies>
16+
17+
<dependency>
18+
<groupId>com.fasterxml.jackson.core</groupId>
19+
<artifactId>jackson-core</artifactId>
20+
<version>2.8.4</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>com.fasterxml.jackson.core</groupId>
24+
<artifactId>jackson-annotations</artifactId>
25+
<version>2.8.4</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>com.fasterxml.jackson.core</groupId>
29+
<artifactId>jackson-databind</artifactId>
30+
<version>2.8.4</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>com.fasterxml.jackson.datatype</groupId>
34+
<artifactId>jackson-datatype-jdk8</artifactId>
35+
<version>2.8.4</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>com.google.guava</groupId>
39+
<artifactId>guava</artifactId>
40+
<version>20.0</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>commons-fileupload</groupId>
44+
<artifactId>commons-fileupload</artifactId>
45+
<version>1.3.1</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>com.graphql-java</groupId>
50+
<artifactId>graphql-java-servlet</artifactId>
51+
<version>2.1.0</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.graphql-java</groupId>
55+
<artifactId>graphql-java</artifactId>
56+
<version>2.2.0</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>com.graphql-java</groupId>
60+
<artifactId>graphql-java-annotations</artifactId>
61+
<version>0.13.1</version>
62+
</dependency>
63+
1664
<dependency>
1765
<groupId>org.oasis_open.contextserver</groupId>
1866
<artifactId>cxs-graphql-api-impl</artifactId>
1967
<version>1.0-SNAPSHOT</version>
2068
</dependency>
69+
2170
</dependencies>
2271

2372
<build>
2473
<plugins>
2574
<plugin>
2675
<groupId>org.apache.karaf.tooling</groupId>
2776
<artifactId>karaf-maven-plugin</artifactId>
28-
<version>${karaf.version}</version>
77+
<version>4.0.8</version>
2978
<extensions>true</extensions>
3079
<configuration>
31-
<startLevel>85</startLevel>
32-
<aggregateFeatures>true</aggregateFeatures>
80+
<startLevel>80</startLevel>
81+
<addTransitiveFeatures>true</addTransitiveFeatures>
82+
<includeTransitiveDependency>true</includeTransitiveDependency>
3383
</configuration>
3484
</plugin>
3585
</plugins>
+5-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
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-
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="cxs-graphql-api-features">
20-
<feature description="Implementation of the Context Server GraphQL API" version="${project.version}" name="cxs-graphql-api-impl">
21-
<bundle start-level="77">mvn:com.graphql-java/graphql-java-servlet/2.1.0</bundle>
22-
<bundle start-level="78">mvn:org.oasis_open.contextserver/cxs-graphql-api-impl/${project.version}</bundle>
2+
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="cxs-graphql-api-features">
3+
<feature name="cxs-graphql-api-features" description="cxs-graphql-api-features" version="1.0.0.SNAPSHOT">
4+
<feature prerequisite="true" dependency="false">wrap</feature>
5+
<feature prerequisite="true" dependency="false">scr</feature>
6+
<feature prerequisite="true" dependency="false">war</feature>
237
</feature>
248
</features>

java/package/pom.xml

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
<type>xml</type>
3030
<scope>runtime</scope>
3131
</dependency>
32+
<dependency>
33+
<!-- scope is runtime so the feature repo is listed in etc/org.apache.karaf.features.cfg file, and features will installed into the system directory if specify in the plugin configuration -->
34+
<groupId>org.apache.karaf.features</groupId>
35+
<artifactId>enterprise</artifactId>
36+
<version>${karaf.version}</version>
37+
<classifier>features</classifier>
38+
<type>xml</type>
39+
<scope>runtime</scope>
40+
</dependency>
3241

3342
<dependency>
3443
<groupId>org.oasis_open.contextserver</groupId>
@@ -86,7 +95,7 @@
8695
</bootFeatures>
8796
<installedFeatures>
8897
<feature>wrapper</feature>
89-
<feature>cxs-graphql-api-impl</feature>
98+
<feature>cxs-graphql-api-features</feature>
9099
</installedFeatures>
91100
</configuration>
92101
</plugin>

0 commit comments

Comments
 (0)