Skip to content

Commit 6ea2f52

Browse files
committed
let injector create remote catlog
1 parent c49b0b5 commit 6ea2f52

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/archetype/ArchetypePlugin.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@
8383
@Component(service = ArchetypePlugin.class)
8484
public class ArchetypePlugin {
8585

86-
/**
87-
*
88-
*/
89-
private static final RemoteCatalogArchetypeDataSource REMOTE_CATALOG = new RemoteCatalogArchetypeDataSource();
90-
9186
private static final InternalCatalogArchetypeDataSource INTERNAL_CATALOG = new InternalCatalogArchetypeDataSource();
9287

9388
private static final LocalCatalogArchetypeDataSource LOCAL_CATALOG = new LocalCatalogArchetypeDataSource();
@@ -108,6 +103,8 @@ public class ArchetypePlugin {
108103

109104
private ArchetypeArtifactManager archetypeArtifactManager;
110105

106+
private RemoteCatalogArchetypeDataSource remoteCatalog;
107+
111108
public ArchetypePlugin() {
112109
this.configFile = new File(MavenPluginActivator.getDefault().getStateLocation().toFile(),
113110
M2EUIPluginActivator.PREFS_ARCHETYPES);
@@ -123,7 +120,6 @@ protected void configure() {
123120
}
124121
};
125122
Slf4jLogger logger = new Slf4jLogger(LoggerFactory.getILoggerFactory().getLogger("catalog"));
126-
REMOTE_CATALOG.enableLogging(logger);
127123
INTERNAL_CATALOG.enableLogging(logger);
128124
LOCAL_CATALOG.enableLogging(logger);
129125
ClassSpace space = new BundleClassSpace(FrameworkUtil.getBundle(ArchetypeArtifactManager.class));
@@ -143,6 +139,10 @@ protected void configure() {
143139
if(archetypeArtifactManager instanceof LogEnabled le) {
144140
le.enableLogging(logger);
145141
}
142+
this.remoteCatalog = injector.getInstance(RemoteCatalogArchetypeDataSource.class);
143+
if(remoteCatalog instanceof LogEnabled le) {
144+
le.enableLogging(logger);
145+
}
146146
addArchetypeCatalogFactory(
147147
new ArchetypeCatalogFactory.InternalCatalogFactory(INTERNAL_CATALOG));
148148
addArchetypeCatalogFactory(new ArchetypeCatalogFactory.DefaultLocalCatalogFactory(maven, LOCAL_CATALOG));
@@ -168,7 +168,7 @@ public LocalCatalogFactory newLocalCatalogFactory(String path, String descriptio
168168

169169
public RemoteCatalogFactory newRemoteCatalogFactory(String url, String description, boolean editable,
170170
boolean enabled) {
171-
return new RemoteCatalogFactory(url, description, editable, enabled, maven, REMOTE_CATALOG);
171+
return new RemoteCatalogFactory(url, description, editable, enabled, maven, remoteCatalog);
172172
}
173173

174174
public ArchetypeGenerator getGenerator() {

0 commit comments

Comments
 (0)