@@ -0,0 +1,3307 @@
+/*%0A *  Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A *%0A *  WSO2 Inc. licenses this file to you under the Apache License,%0A *  Version 2.0 (the %22License%22); you may not use this file except%0A *  in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *  http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A */%0A%0Apackage org.wso2.carbon.uuf.maven;%0A%0Aimport org.apache.maven.execution.MavenSession;%0Aimport org.apache.maven.plugin.BuildPluginManager;%0Aimport org.apache.maven.plugin.MojoExecutionException;%0Aimport org.apache.maven.plugin.MojoFailureException;%0Aimport org.apache.maven.plugins.annotations.Component;%0Aimport org.apache.maven.plugins.annotations.LifecyclePhase;%0Aimport org.apache.maven.plugins.annotations.Mojo;%0Aimport org.apache.maven.plugins.annotations.Parameter;%0Aimport org.apache.maven.plugins.annotations.ResolutionScope;%0A%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.configuration;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.goal;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.groupId;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.plugin;%0Aimport static org.twdata.maven.mojoexecutor.MojoExecutor.version;%0A%0A@Mojo(name = %22test-jar%22, inheritByDefault = false, requiresDependencyResolution = ResolutionScope.COMPILE,%0A        threadSafe = true, defaultPhase = LifecyclePhase.PACKAGE)%0Apublic class TestJarMojo extends AbstractUUFMojo %7B%0A%0A    /**%0A     * The Maven session associated with this Mojo.%0A     */%0A    @Parameter(defaultValue = %22$%7Bsession%7D%22, readonly = true, required = true)%0A    private MavenSession session;%0A%0A    /**%0A     * Plugin manager to execute other Maven plugins.%0A     */%0A    @Component(hint = %22default%22)%0A    private BuildPluginManager pluginManager;%0A%0A    /**%0A     * Maven Compiler Plugin version to use.%0A     */%0A    @Parameter(defaultValue = %223.6.1%22, readonly = true, required = false)%0A    private String compilerPluginVersion;%0A%0A    @Override%0A    public void execute() throws MojoExecutionException, MojoFailureException %7B%0A        compileTestSrc();%0A    %7D%0A%0A    private void compileTestSrc() throws MojoExecutionException %7B%0A        try %7B%0A            executeMojo(%0A                    plugin(%0A                            groupId(%22org.apache.maven.plugins%22),%0A                            artifactId(%22maven-compiler-plugin%22),%0A                            version(compilerPluginVersion)%0A                    ),%0A                    goal(%22testCompile%22),%0A                    configuration(),%0A                    executionEnvironment(project, session, pluginManager)%0A            );%0A        %7D catch (MojoExecutionException e) %7B%0A            throw new MojoExecutionException(%22Error when compiling test source for '%22 + artifactId + %22'.%22, e);%0A        %7D%0A    %7D%0A%7D%0A

Implement compiler-plugin functionality