diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java new file mode 100644 index 0000000000..17b0d79da5 --- /dev/null +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java @@ -0,0 +1,61 @@ +package org.apache.maven.lifecycle.providers; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.mapping.LifecyclePhase; + +@Named( "clean" ) +@Singleton +public final class CleanLifecycleProvider + implements Provider +{ + private final Lifecycle lifecycle; + + @Inject + public CleanLifecycleProvider() + { + this.lifecycle = new Lifecycle( + "clean", + ImmutableList.of( + "pre-clean", + "clean", + "post-clean" + ), + ImmutableMap.of( + "clean", + new LifecyclePhase( "org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean" ) + ) + ); + } + + @Override + public Lifecycle get() + { + return lifecycle; + } +} diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/DefaultLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/DefaultLifecycleProvider.java new file mode 100644 index 0000000000..6039e80839 --- /dev/null +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/DefaultLifecycleProvider.java @@ -0,0 +1,76 @@ +package org.apache.maven.lifecycle.providers; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import com.google.common.collect.ImmutableList; +import org.apache.maven.lifecycle.Lifecycle; + +@Named( "default" ) +@Singleton +public final class DefaultLifecycleProvider + implements Provider +{ + private final Lifecycle lifecycle; + + @Inject + public DefaultLifecycleProvider() + { + this.lifecycle = new Lifecycle( + "default", + ImmutableList.of( + "validate", + "initialize", + "generate-sources", + "process-sources", + "generate-resources", + "process-resources", + "compile", + "process-classes", + "generate-test-sources", + "process-test-sources", + "generate-test-resources", + "process-test-resources", + "test-compile", + "process-test-classes", + "test", + "prepare-package", + "package", + "pre-integration-test", + "integration-test", + "post-integration-test", + "verify", + "install", + "deploy" + ), + null + ); + } + + @Override + public Lifecycle get() + { + return lifecycle; + } +} diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/SiteLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/SiteLifecycleProvider.java new file mode 100644 index 0000000000..68980ab0dd --- /dev/null +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/SiteLifecycleProvider.java @@ -0,0 +1,64 @@ +package org.apache.maven.lifecycle.providers; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.mapping.LifecyclePhase; + +@Named( "site" ) +@Singleton +public final class SiteLifecycleProvider + implements Provider +{ + private final Lifecycle lifecycle; + + @Inject + public SiteLifecycleProvider() + { + this.lifecycle = new Lifecycle( + "site", + ImmutableList.of( + "pre-site", + "site", + "post-site", + "site-deploy" + ), + ImmutableMap.of( + "site", + new LifecyclePhase( "org.apache.maven.plugins:maven-site-plugin:3.9.1:site" ), + "site-deploy", + new LifecyclePhase( "org.apache.maven.plugins:maven-site-plugin:3.9.1:deploy" ) + ) + ); + } + + @Override + public Lifecycle get() + { + return lifecycle; + } +} diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/WrapperLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/WrapperLifecycleProvider.java new file mode 100644 index 0000000000..d951f74094 --- /dev/null +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/WrapperLifecycleProvider.java @@ -0,0 +1,59 @@ +package org.apache.maven.lifecycle.providers; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.mapping.LifecyclePhase; + +@Named( "wrapper" ) +@Singleton +public final class WrapperLifecycleProvider + implements Provider +{ + private final Lifecycle lifecycle; + + @Inject + public WrapperLifecycleProvider() + { + this.lifecycle = new Lifecycle( + "wrapper", + ImmutableList.of( + "wrapper" + ), + ImmutableMap.of( + "wrapper", + new LifecyclePhase( "org.apache.maven.plugins:maven-wrapper-plugin:3.0.2:wrapper" ) + ) + ); + } + + @Override + public Lifecycle get() + { + return lifecycle; + } +} diff --git a/maven-core/src/main/resources/META-INF/plexus/components.xml b/maven-core/src/main/resources/META-INF/plexus/components.xml deleted file mode 100644 index bd2aa6c998..0000000000 --- a/maven-core/src/main/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - org.apache.maven.lifecycle.Lifecycle - org.apache.maven.lifecycle.Lifecycle - default - - default - - - validate - initialize - generate-sources - process-sources - generate-resources - process-resources - compile - process-classes - generate-test-sources - process-test-sources - generate-test-resources - process-test-resources - test-compile - process-test-classes - test - prepare-package - package - pre-integration-test - integration-test - post-integration-test - verify - install - deploy - - - - - - - - org.apache.maven.lifecycle.Lifecycle - org.apache.maven.lifecycle.Lifecycle - clean - - clean - - - pre-clean - clean - post-clean - - - - org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean - - - - - - - - - org.apache.maven.lifecycle.Lifecycle - org.apache.maven.lifecycle.Lifecycle - site - - site - - - pre-site - site - post-site - site-deploy - - - - org.apache.maven.plugins:maven-site-plugin:3.9.1:site - - - org.apache.maven.plugins:maven-site-plugin:3.9.1:deploy - - - - - - - - - org.apache.maven.lifecycle.Lifecycle - org.apache.maven.lifecycle.Lifecycle - wrapper - - wrapper - - - wrapper - - - - org.apache.maven.plugins:maven-wrapper-plugin:3.0.2:wrapper - - - - - - - - org.sonatype.plexus.components.sec.dispatcher.SecDispatcher - maven - org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher - Maven Security dispatcher - - - org.sonatype.plexus.components.cipher.PlexusCipher - _cipher - - - org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor - _decryptors - - - - <_configuration-file>~/.m2/settings-security.xml - - - - diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java new file mode 100644 index 0000000000..e59d7e0592 --- /dev/null +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java @@ -0,0 +1,56 @@ +package org.apache.maven.settings.crypto; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.Map; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.inject.Singleton; + +import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; +import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher; +import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; + +@Named( "maven" ) +@Singleton +public final class MavenSecDispatcherProvider + implements Provider +{ + private final SecDispatcher secDispatcher; + + @Inject + public MavenSecDispatcherProvider( final Map decryptors ) + { + this.secDispatcher = new DefaultSecDispatcher( + new DefaultPlexusCipher(), + decryptors, + "~/.m2/settings-security.xml" + ); + } + + @Override + public SecDispatcher get() + { + return secDispatcher; + } +}