2 * Copyright © 2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on a "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.onboarding;
20 import java.io.IOException;
21 import java.io.UncheckedIOException;
22 import java.nio.file.Files;
23 import java.nio.file.Paths;
24 import java.util.List;
25 import java.util.stream.Collectors;
26 import org.apache.maven.plugin.MojoExecutionException;
27 import org.apache.maven.plugin.MojoFailureException;
28 import org.apache.maven.plugins.annotations.LifecyclePhase;
29 import org.apache.maven.plugins.annotations.Mojo;
30 import org.apache.maven.plugins.annotations.ResolutionScope;
33 @Mojo(name = "post-source-generator-helper", threadSafe = true, defaultPhase = LifecyclePhase.GENERATE_RESOURCES,
34 requiresDependencyResolution = ResolutionScope.TEST)
35 public class PostSourceGeneratorMojo extends PreCompileHelperMojo {
37 public void execute() throws MojoExecutionException, MojoFailureException {
38 if (isCodeGenerator()) {
44 void deleteAllClasses(File file) {
50 Files.walk(Paths.get(file.getAbsolutePath())).filter(Files::isRegularFile).map(p -> p.toFile())
51 .collect(Collectors.toList());
55 } catch (IOException e) {
56 throw new UncheckedIOException(e);