forked from adobe/aemanalyser-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove remaining legacy plexus components
This relates to adobe#206
- Loading branch information
Showing
7 changed files
with
190 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...main/java/com/adobe/aem/analyser/mojos/extensions/AemAnalyseLifecycleMappingProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
Copyright 2024 Cognizant Netcentric. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
package com.adobe.aem.analyser.mojos.extensions; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Provider; | ||
import javax.inject.Singleton; | ||
|
||
import org.apache.maven.lifecycle.mapping.Lifecycle; | ||
import org.apache.maven.lifecycle.mapping.LifecycleMapping; | ||
import org.apache.maven.lifecycle.mapping.LifecyclePhase; | ||
|
||
import com.adobe.aem.analyser.mojos.Constants; | ||
|
||
@Singleton | ||
@Named(Constants.PACKAGING_AEM_ANALYSE) | ||
public class AemAnalyseLifecycleMappingProvider implements Provider<LifecycleMapping> { | ||
|
||
private static final String DEFAULT_LIFECYCLE_KEY = "default"; | ||
private static final Map<String, LifecyclePhase> BINDINGS; | ||
static { | ||
BINDINGS = new HashMap<>(); | ||
BINDINGS.put("test", new LifecyclePhase("com.adobe.aem:aemanalyser-maven-plugin:analyse")); | ||
} | ||
|
||
private final Lifecycle defaultLifecycle; | ||
|
||
private final LifecycleMapping lifecycleMapping; | ||
|
||
public AemAnalyseLifecycleMappingProvider() { | ||
this.defaultLifecycle = new Lifecycle(); | ||
this.defaultLifecycle.setId(DEFAULT_LIFECYCLE_KEY); | ||
this.defaultLifecycle.setLifecyclePhases(BINDINGS); | ||
|
||
this.lifecycleMapping = new LifecycleMapping() { | ||
@Override | ||
public Map<String, Lifecycle> getLifecycles() { | ||
return Collections.singletonMap(DEFAULT_LIFECYCLE_KEY, defaultLifecycle); | ||
} | ||
|
||
@Override | ||
public List<String> getOptionalMojos(String lifecycle) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, String> getPhases(String lifecycle) { | ||
if (DEFAULT_LIFECYCLE_KEY.equals(lifecycle)) { | ||
return defaultLifecycle.getPhases(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public LifecycleMapping get() { | ||
return lifecycleMapping; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...n-plugin/src/main/java/com/adobe/aem/analyser/mojos/extensions/AemAppArtifactHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
Copyright 2024 Cognizant Netcentric. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
package com.adobe.aem.analyser.mojos.extensions; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Singleton; | ||
|
||
import org.apache.maven.artifact.handler.DefaultArtifactHandler; | ||
|
||
import com.adobe.aem.analyser.mojos.Constants; | ||
|
||
@Singleton | ||
@Named(Constants.PACKAGING_AEMAPP) | ||
public class AemAppArtifactHandler extends DefaultArtifactHandler { | ||
|
||
public AemAppArtifactHandler() { | ||
super(Constants.PACKAGING_AEMAPP); | ||
setIncludesDependencies(false); | ||
setExtension("zip"); | ||
setLanguage("java"); | ||
setAddedToClasspath(false); | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
...src/main/java/com/adobe/aem/analyser/mojos/extensions/AemAppLifecycleMappingProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
Copyright 2024 Cognizant Netcentric. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
package com.adobe.aem.analyser.mojos.extensions; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Provider; | ||
import javax.inject.Singleton; | ||
|
||
import org.apache.maven.lifecycle.mapping.Lifecycle; | ||
import org.apache.maven.lifecycle.mapping.LifecycleMapping; | ||
import org.apache.maven.lifecycle.mapping.LifecyclePhase; | ||
|
||
import com.adobe.aem.analyser.mojos.Constants; | ||
|
||
@Singleton | ||
@Named(Constants.PACKAGING_AEMAPP) | ||
public class AemAppLifecycleMappingProvider implements Provider<LifecycleMapping> { | ||
|
||
private static final String DEFAULT_LIFECYCLE_KEY = "default"; | ||
private static final Map<String, LifecyclePhase> BINDINGS; | ||
static { | ||
BINDINGS = new HashMap<>(); | ||
BINDINGS.put("package", new LifecyclePhase("com.adobe.aem:aemanalyser-maven-plugin:package-app")); | ||
BINDINGS.put("verify", new LifecyclePhase("com.adobe.aem:aemanalyser-maven-plugin:project-analyse")); | ||
BINDINGS.put("install", new LifecyclePhase("org.apache.maven.plugins:maven-install-plugin:install")); | ||
BINDINGS.put("deploy", new LifecyclePhase("org.apache.maven.plugins:maven-deploy-plugin:deploy")); | ||
} | ||
|
||
private final Lifecycle defaultLifecycle; | ||
|
||
private final LifecycleMapping lifecycleMapping; | ||
|
||
public AemAppLifecycleMappingProvider() { | ||
this.defaultLifecycle = new Lifecycle(); | ||
this.defaultLifecycle.setId(DEFAULT_LIFECYCLE_KEY); | ||
this.defaultLifecycle.setLifecyclePhases(BINDINGS); | ||
|
||
this.lifecycleMapping = new LifecycleMapping() { | ||
@Override | ||
public Map<String, Lifecycle> getLifecycles() { | ||
return Collections.singletonMap(DEFAULT_LIFECYCLE_KEY, defaultLifecycle); | ||
} | ||
|
||
@Override | ||
public List<String> getOptionalMojos(String lifecycle) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, String> getPhases(String lifecycle) { | ||
if (DEFAULT_LIFECYCLE_KEY.equals(lifecycle)) { | ||
return defaultLifecycle.getPhases(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public LifecycleMapping get() { | ||
return lifecycleMapping; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
aemanalyser-maven-plugin/src/main/resources/META-INF/plexus/components.xml
This file was deleted.
Oops, something went wrong.