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;
19 import org.apache.maven.plugin.MojoExecutionException;
20 import org.apache.maven.plugin.MojoFailureException;
21 import org.apache.maven.plugins.annotations.LifecyclePhase;
22 import org.apache.maven.plugins.annotations.Mojo;
23 import org.apache.maven.plugins.annotations.ResolutionScope;
26 import java.io.IOException;
27 import java.io.UncheckedIOException;
28 import java.nio.file.Files;
29 import java.nio.file.Paths;
30 import java.util.List;
31 import java.util.stream.Collectors;
34 @Mojo(name = "post-source-generator-helper", threadSafe = true, defaultPhase = LifecyclePhase.GENERATE_RESOURCES,
35 requiresDependencyResolution = ResolutionScope.TEST)
36 public class PostSourceGeneratorMojo extends PreCompileHelperMojo {
38 public void execute() throws MojoExecutionException, MojoFailureException {
39 if (isCodeGenerator()) {
45 void deleteAllClasses(File file) {
51 Files.walk(Paths.get(file.getAbsolutePath())).filter(Files::isRegularFile).map(p -> p.toFile())
52 .collect(Collectors.toList());
56 } catch (IOException e) {
57 throw new UncheckedIOException(e);