Skip to content

Commit 316828e

Browse files
authored
Merge pull request #229 from deftdevs/spring-java
Use Spring Java instead of Sprint Scanner to resolve dependencies
2 parents c4ff62f + c0d11b0 commit 316828e

File tree

113 files changed

+1008
-733509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1008
-733509
lines changed

.doc/CODE_CONVENTIONS.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ public interface EntitiesResource {
157157
----
158158
@Path(BootstrAPI.ENTITIES)
159159
@ResourceFilters(AdminOnlyResourceFilter.class)
160-
@Component
161160
public class EntitiesResourceImpl implements EntitiesResource {
162161
163162
private static final Logger log = LoggerFactory.getLogger(EntitiesResourceImpl.class);
164163
165164
private final EntitiesService entitiesService;
166165
167-
@Inject
168-
public EntitiesResourceImpl(EntitiesService entitiesService) {
166+
public EntitiesResourceImpl(
167+
final EntitiesService entitiesService) {
168+
169169
this.entitiesService = entitiesService;
170170
}
171171

commons/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,6 @@
141141
<scope>provided</scope>
142142
</dependency>
143143

144-
<dependency>
145-
<groupId>javax.inject</groupId>
146-
<artifactId>javax.inject</artifactId>
147-
<scope>provided</scope>
148-
</dependency>
149-
150144
<dependency>
151145
<groupId>javax.validation</groupId>
152146
<artifactId>validation-api</artifactId>

commons/src/main/java/com/deftdevs/bootstrapi/commons/rest/AbstractPermissionsResourceImpl.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
import com.deftdevs.bootstrapi.commons.model.PermissionsGlobalModel;
44
import com.deftdevs.bootstrapi.commons.rest.api.PermissionsResource;
55
import com.deftdevs.bootstrapi.commons.service.api.PermissionsService;
6-
import org.springframework.stereotype.Component;
76

8-
import javax.inject.Inject;
97
import javax.validation.constraints.NotNull;
108
import javax.ws.rs.core.Response;
119

12-
@Component
1310
public abstract class AbstractPermissionsResourceImpl implements PermissionsResource {
1411

1512
private final PermissionsService permissionsService;
1613

17-
@Inject
1814
public AbstractPermissionsResourceImpl(PermissionsService permissionsService) {
1915
this.permissionsService = permissionsService;
2016
}

commons/src/main/java/com/deftdevs/bootstrapi/commons/rest/AbstractSettingsSecurityResourceImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
import com.deftdevs.bootstrapi.commons.rest.api.SettingsSecurityResource;
55
import com.deftdevs.bootstrapi.commons.service.api.SettingsSecurityService;
66

7-
import javax.inject.Inject;
87
import javax.ws.rs.core.Response;
98

109
public abstract class AbstractSettingsSecurityResourceImpl<B extends SettingsSecurityModel, S extends SettingsSecurityService<B>>
1110
implements SettingsSecurityResource<B> {
1211

1312
private final S settingsSecurityService;
1413

15-
@Inject
1614
public AbstractSettingsSecurityResourceImpl(
1715
final S settingsSecurityService) {
1816

confluence/it.log

Lines changed: 0 additions & 732804 deletions
This file was deleted.

confluence/pom.xml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
</developers>
5050

5151
<properties>
52-
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
5352
<confluence.version>8.5.22</confluence.version>
5453
<confluence.data.version>8.5.6</confluence.data.version>
54+
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
5555
<ajp.port>8109</ajp.port>
5656
<!-- other properties -->
5757
<confluence.ancillary.plugins.version>20.0.41</confluence.ancillary.plugins.version>
@@ -206,26 +206,31 @@
206206
</dependency>
207207

208208
<dependency>
209-
<groupId>com.atlassian.plugin</groupId>
210-
<artifactId>atlassian-spring-scanner-annotation</artifactId>
209+
<groupId>com.atlassian.plugins</groupId>
210+
<artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
211+
</dependency>
212+
213+
<dependency>
214+
<groupId>org.osgi</groupId>
215+
<artifactId>osgi.core</artifactId>
211216
<scope>provided</scope>
212217
</dependency>
213218

214219
<dependency>
215220
<groupId>org.springframework</groupId>
216-
<artifactId>spring-context</artifactId>
221+
<artifactId>spring-beans</artifactId>
217222
<scope>provided</scope>
218223
</dependency>
219224

220225
<dependency>
221-
<groupId>jakarta.ws.rs</groupId>
222-
<artifactId>jakarta.ws.rs-api</artifactId>
226+
<groupId>org.springframework</groupId>
227+
<artifactId>spring-context</artifactId>
223228
<scope>provided</scope>
224229
</dependency>
225230

226231
<dependency>
227-
<groupId>javax.inject</groupId>
228-
<artifactId>javax.inject</artifactId>
232+
<groupId>jakarta.ws.rs</groupId>
233+
<artifactId>jakarta.ws.rs-api</artifactId>
229234
<scope>provided</scope>
230235
</dependency>
231236

@@ -329,19 +334,6 @@
329334
</configuration>
330335
</plugin>
331336

332-
<plugin>
333-
<groupId>com.atlassian.plugin</groupId>
334-
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
335-
<executions>
336-
<execution>
337-
<phase>process-classes</phase>
338-
<goals>
339-
<goal>atlassian-spring-scanner</goal>
340-
</goals>
341-
</execution>
342-
</executions>
343-
</plugin>
344-
345337
<plugin>
346338
<groupId>io.swagger.core.v3</groupId>
347339
<artifactId>swagger-maven-plugin</artifactId>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.deftdevs.bootstrapi.confluence;
2+
3+
import com.deftdevs.bootstrapi.confluence.config.AtlassianConfig;
4+
import com.deftdevs.bootstrapi.confluence.config.HelperConfig;
5+
import com.deftdevs.bootstrapi.confluence.config.ServiceConfig;
6+
import org.springframework.context.annotation.Configuration;
7+
import org.springframework.context.annotation.Import;
8+
9+
@Configuration
10+
@Import({
11+
AtlassianConfig.class,
12+
HelperConfig.class,
13+
ServiceConfig.class,
14+
})
15+
public class AppConfig {
16+
}
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
package com.deftdevs.bootstrapi.confluence.config;
2+
3+
import com.atlassian.applinks.core.ApplinkStatusService;
4+
import com.atlassian.applinks.spi.auth.AuthenticationConfigurationManager;
5+
import com.atlassian.applinks.spi.link.MutatingApplicationLinkService;
6+
import com.atlassian.applinks.spi.util.TypeAccessor;
7+
import com.atlassian.cache.CacheManager;
8+
import com.atlassian.confluence.languages.LocaleManager;
9+
import com.atlassian.confluence.plugins.lookandfeel.SiteLogoManager;
10+
import com.atlassian.confluence.security.PermissionManager;
11+
import com.atlassian.confluence.security.SpacePermissionManager;
12+
import com.atlassian.confluence.setup.settings.GlobalSettingsManager;
13+
import com.atlassian.confluence.themes.ColourSchemeManager;
14+
import com.atlassian.confluence.user.UserAccessor;
15+
import com.atlassian.crowd.embedded.api.CrowdDirectoryService;
16+
import com.atlassian.favicon.core.FaviconManager;
17+
import com.atlassian.gadgets.directory.spi.ExternalGadgetSpecStore;
18+
import com.atlassian.gadgets.spec.GadgetSpecFactory;
19+
import com.atlassian.mail.server.MailServerManager;
20+
import com.atlassian.oauth.consumer.ConsumerService;
21+
import com.atlassian.oauth.consumer.ConsumerTokenStore;
22+
import com.atlassian.oauth.serviceprovider.ServiceProviderConsumerStore;
23+
import com.atlassian.oauth.serviceprovider.ServiceProviderTokenStore;
24+
import com.atlassian.plugins.authentication.api.config.IdpConfigService;
25+
import com.atlassian.plugins.authentication.api.config.SsoConfigService;
26+
import com.atlassian.sal.api.ApplicationProperties;
27+
import com.atlassian.sal.api.license.LicenseHandler;
28+
import com.atlassian.user.UserManager;
29+
import org.springframework.context.annotation.Bean;
30+
import org.springframework.context.annotation.Configuration;
31+
32+
import static com.atlassian.plugins.osgi.javaconfig.OsgiServices.importOsgiService;
33+
34+
@Configuration
35+
public class AtlassianConfig {
36+
37+
@Bean
38+
public ApplicationProperties applicationProperties() {
39+
return importOsgiService(ApplicationProperties.class);
40+
}
41+
42+
@Bean
43+
public ApplinkStatusService applinkStatusService() {
44+
return importOsgiService(ApplinkStatusService.class);
45+
}
46+
47+
@Bean
48+
public AuthenticationConfigurationManager authenticationConfigurationManager() {
49+
return importOsgiService(AuthenticationConfigurationManager.class);
50+
}
51+
52+
@Bean
53+
public CacheManager cacheManager() {
54+
return importOsgiService(CacheManager.class);
55+
}
56+
57+
@Bean
58+
public ColourSchemeManager colourSchemeManager() {
59+
return importOsgiService(ColourSchemeManager.class);
60+
}
61+
62+
@Bean
63+
public ConsumerService consumerService() {
64+
return importOsgiService(ConsumerService.class);
65+
}
66+
67+
@Bean
68+
public ConsumerTokenStore consumerTokenStore() {
69+
return importOsgiService(ConsumerTokenStore.class);
70+
}
71+
72+
@Bean
73+
public CrowdDirectoryService crowdDirectoryService() {
74+
return importOsgiService(CrowdDirectoryService.class);
75+
}
76+
77+
@Bean
78+
public ExternalGadgetSpecStore externalGadgetSpecStore() {
79+
return importOsgiService(ExternalGadgetSpecStore.class);
80+
}
81+
82+
@Bean
83+
public FaviconManager faviconManager() {
84+
return importOsgiService(FaviconManager.class);
85+
}
86+
87+
@Bean
88+
public GadgetSpecFactory gadgetSpecFactory() {
89+
return importOsgiService(GadgetSpecFactory.class);
90+
}
91+
92+
@Bean
93+
public GlobalSettingsManager globalSettingsManager() {
94+
return importOsgiService(GlobalSettingsManager.class);
95+
}
96+
97+
@Bean
98+
public IdpConfigService idpConfigService() {
99+
return importOsgiService(IdpConfigService.class);
100+
}
101+
102+
@Bean
103+
public LicenseHandler licenseHandler() {
104+
return importOsgiService(LicenseHandler.class);
105+
}
106+
107+
@Bean
108+
public LocaleManager localeManager() {
109+
return importOsgiService(LocaleManager.class);
110+
}
111+
112+
@Bean
113+
public MailServerManager mailServerManager() {
114+
return importOsgiService(MailServerManager.class);
115+
}
116+
117+
@Bean
118+
public MutatingApplicationLinkService mutatingApplicationLinkService() {
119+
return importOsgiService(MutatingApplicationLinkService.class);
120+
}
121+
122+
@Bean
123+
public PermissionManager permissionManager() {
124+
return importOsgiService(PermissionManager.class);
125+
}
126+
127+
@Bean
128+
public ServiceProviderConsumerStore serviceProviderConsumerStore() {
129+
return importOsgiService(ServiceProviderConsumerStore.class);
130+
}
131+
132+
@Bean
133+
public ServiceProviderTokenStore serviceProviderTokenStore() {
134+
return importOsgiService(ServiceProviderTokenStore.class);
135+
}
136+
137+
@Bean
138+
public SiteLogoManager siteLogoManager() {
139+
return importOsgiService(SiteLogoManager.class);
140+
}
141+
142+
@Bean
143+
public SpacePermissionManager spacePermissionManager() {
144+
return importOsgiService(SpacePermissionManager.class);
145+
}
146+
147+
@Bean
148+
public SsoConfigService ssoConfigService() {
149+
return importOsgiService(SsoConfigService.class);
150+
}
151+
152+
@Bean
153+
public TypeAccessor typeAccessor() {
154+
return importOsgiService(TypeAccessor.class);
155+
}
156+
157+
@Bean
158+
public UserAccessor userAccessor() {
159+
return importOsgiService(UserAccessor.class);
160+
}
161+
162+
@Bean
163+
public UserManager userManager() {
164+
return importOsgiService(UserManager.class);
165+
}
166+
167+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.deftdevs.bootstrapi.confluence.config;
2+
3+
import com.deftdevs.bootstrapi.commons.helper.api.ApplicationLinksAuthConfigHelper;
4+
import com.deftdevs.bootstrapi.confluence.helper.ApplicationLinksAuthConfigHelperImpl;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.context.annotation.Bean;
7+
import org.springframework.context.annotation.Configuration;
8+
9+
@Configuration
10+
public class HelperConfig {
11+
12+
@Autowired
13+
private AtlassianConfig atlassianConfig;
14+
15+
@Bean
16+
public ApplicationLinksAuthConfigHelper applicationLinksAuthConfigHelper() {
17+
return new ApplicationLinksAuthConfigHelperImpl(
18+
atlassianConfig.authenticationConfigurationManager(),
19+
atlassianConfig.consumerService(),
20+
atlassianConfig.consumerTokenStore(),
21+
atlassianConfig.serviceProviderConsumerStore(),
22+
atlassianConfig.serviceProviderTokenStore());
23+
}
24+
25+
}

0 commit comments

Comments
 (0)