1 package com.atlassian.maven.plugins.amps.product;
2
3 import com.atlassian.maven.plugins.amps.MavenContext;
4 import com.atlassian.maven.plugins.amps.MavenGoals;
5 import com.atlassian.maven.plugins.amps.Product;
6 import com.atlassian.maven.plugins.amps.ProductArtifact;
7 import com.atlassian.maven.plugins.amps.util.VersionUtils;
8 import java.io.File;
9 import java.util.*;
10
11 public class RefappProductHandler extends AbstractWebappProductHandler
12 {
13 public RefappProductHandler(MavenContext context, MavenGoals goals)
14 {
15 super(context, goals, new RefappPluginProvider());
16 }
17
18 public String getId()
19 {
20 return "refapp";
21 }
22
23 public int getDefaultHttpPort()
24 {
25 return 5990;
26 }
27
28 @Override
29 protected File getUserInstalledPluginsDirectory(final File webappDir, File homeDir)
30 {
31 return null;
32 }
33
34 @Override
35 protected List<ProductArtifact> getExtraContainerDependencies()
36 {
37 return Collections.emptyList();
38 }
39
40 @Override
41 protected String getBundledPluginPath(Product ctx)
42 {
43 return "WEB-INF/classes/atlassian-bundled-plugins.zip";
44 }
45
46 @Override
47 protected List<ProductArtifact> getDefaultLibPlugins()
48 {
49 return Collections.emptyList();
50 }
51
52 @Override
53 protected List<ProductArtifact> getDefaultBundledPlugins()
54 {
55 return Collections.emptyList();
56 }
57
58 @Override
59 protected Map<String, String> getSystemProperties(Product ctx)
60 {
61 Map<String, String> map = new HashMap<String, String>();
62 map.put("refapp.home", getHomeDirectory(ctx).getPath());
63 map.put("osgi.cache", getHomeDirectory(ctx).getPath()+ "/osgi-cache");
64 map.put("bundledplugins.cache", getHomeDirectory(ctx).getPath()+ "/bundled-plugins");
65 return map;
66 }
67
68 @Override
69 protected ProductArtifact getArtifact()
70 {
71 return new ProductArtifact("com.atlassian.refapp", "atlassian-refapp", VersionUtils.getVersion());
72 }
73
74 @Override
75 protected ProductArtifact getTestResourcesArtifact()
76 {
77 return null;
78 }
79
80 private static class RefappPluginProvider extends AbstractPluginProvider
81 {
82
83 @Override
84 protected Collection<ProductArtifact> getSalArtifacts(String salVersion)
85 {
86 return Arrays.asList(
87 new ProductArtifact("com.atlassian.sal", "sal-api", salVersion),
88 new ProductArtifact("com.atlassian.sal", "sal-refimpl-appproperties-plugin", salVersion),
89 new ProductArtifact("com.atlassian.sal", "sal-refimpl-component-plugin", salVersion),
90 new ProductArtifact("com.atlassian.sal", "sal-refimpl-executor-plugin", salVersion),
91 new ProductArtifact("com.atlassian.sal", "sal-refimpl-lifecycle-plugin", salVersion),
92 new ProductArtifact("com.atlassian.sal", "sal-refimpl-message-plugin", salVersion),
93 new ProductArtifact("com.atlassian.sal", "sal-refimpl-net-plugin", salVersion),
94 new ProductArtifact("com.atlassian.sal", "sal-refimpl-pluginsettings-plugin", salVersion),
95 new ProductArtifact("com.atlassian.sal", "sal-refimpl-project-plugin", salVersion),
96 new ProductArtifact("com.atlassian.sal", "sal-refimpl-search-plugin", salVersion),
97 new ProductArtifact("com.atlassian.sal", "sal-refimpl-transaction-plugin", salVersion),
98 new ProductArtifact("com.atlassian.sal", "sal-refimpl-upgrade-plugin", salVersion),
99 new ProductArtifact("com.atlassian.sal", "sal-refimpl-user-plugin", salVersion));
100 }
101
102 @Override
103 protected Collection<ProductArtifact> getPdkInstallArtifacts(String pdkInstallVersion)
104 {
105 return Collections.emptyList();
106 }
107 }
108 }