Compare commits
1 Commits
master
...
maven-plug
| Author | SHA1 | Date |
|---|---|---|
|
|
a5b167db45 |
|
|
@ -1,15 +0,0 @@
|
|||
target
|
||||
|
||||
#idea
|
||||
*.iml
|
||||
.idea
|
||||
out/
|
||||
|
||||
#eclipse
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
|
||||
.DS_Store
|
||||
|
||||
.java-version
|
||||
|
|
@ -1 +0,0 @@
|
|||
asfMavenStdBuild(javaVersions:['8','7'])
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
mvn -Preporting site site:stage $@
|
||||
mvn scm-publish:publish-scm $@
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
|
||||
<name>Maven Plugin Tools Java 5 Annotations</name>
|
||||
<description>Java 5 annotations to use in Mojos</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Used to configure injection of Plexus components by
|
||||
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/MavenPluginManager.html">
|
||||
* <code>MavenPluginManager.getConfiguredMojo(...)</code></a>.
|
||||
*
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention( RetentionPolicy.CLASS )
|
||||
@Target( { ElementType.FIELD } )
|
||||
@Inherited
|
||||
public @interface Component
|
||||
{
|
||||
/**
|
||||
* role of the component to inject.
|
||||
* @return the role
|
||||
*/
|
||||
Class<?> role() default Object.class;
|
||||
|
||||
/**
|
||||
* hint of the component to inject.
|
||||
* @return the hint
|
||||
*/
|
||||
String hint() default "";
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Used if your Mojo needs to fork a <a href="/ref/3.0.4/maven-core/lifecycles.html">lifecycle</a>.
|
||||
*
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention( RetentionPolicy.CLASS )
|
||||
@Target( ElementType.TYPE )
|
||||
@Inherited
|
||||
public @interface Execute
|
||||
{
|
||||
/**
|
||||
* lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
|
||||
* @return the phase
|
||||
*/
|
||||
LifecyclePhase phase() default LifecyclePhase.NONE;
|
||||
|
||||
/**
|
||||
* goal to fork. Note that specifying a phase overrides specifying a goal.
|
||||
* @return the goal
|
||||
*/
|
||||
String goal() default "";
|
||||
|
||||
/**
|
||||
* lifecycle id to fork.
|
||||
* @return the lifecycle id
|
||||
*/
|
||||
String lifecycle() default "";
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Component instantiation strategy.
|
||||
*
|
||||
* @author Hervé Boutemy
|
||||
* @since 3.0
|
||||
*/
|
||||
public enum InstantiationStrategy
|
||||
{
|
||||
PER_LOOKUP( "per-lookup" ),
|
||||
SINGLETON( "singleton" ),
|
||||
KEEP_ALIVE( "keep-alive" ),
|
||||
POOLABLE( "poolable" );
|
||||
|
||||
private final String id;
|
||||
|
||||
InstantiationStrategy( String id )
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String id()
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* <a href="/ref/3.0.4/maven-core/lifecycles.html">Lifecycle phases</a>.
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
*/
|
||||
public enum LifecyclePhase
|
||||
{
|
||||
|
||||
VALIDATE( "validate" ),
|
||||
INITIALIZE( "initialize" ),
|
||||
GENERATE_SOURCES( "generate-sources" ),
|
||||
PROCESS_SOURCES( "process-sources" ),
|
||||
GENERATE_RESOURCES( "generate-resources" ),
|
||||
PROCESS_RESOURCES( "process-resources" ),
|
||||
COMPILE( "compile" ),
|
||||
PROCESS_CLASSES( "process-classes" ),
|
||||
GENERATE_TEST_SOURCES( "generate-test-sources" ),
|
||||
PROCESS_TEST_SOURCES( "process-test-sources" ),
|
||||
GENERATE_TEST_RESOURCES( "generate-test-resources" ),
|
||||
PROCESS_TEST_RESOURCES( "process-test-resources" ),
|
||||
TEST_COMPILE( "test-compile" ),
|
||||
PROCESS_TEST_CLASSES( "process-test-classes" ),
|
||||
TEST( "test" ),
|
||||
PREPARE_PACKAGE( "prepare-package" ),
|
||||
PACKAGE( "package" ),
|
||||
PRE_INTEGRATION_TEST( "pre-integration-test" ),
|
||||
INTEGRATION_TEST( "integration-test" ),
|
||||
POST_INTEGRATION_TEST( "post-integration-test" ),
|
||||
VERIFY( "verify" ),
|
||||
INSTALL( "install" ),
|
||||
DEPLOY( "deploy" ),
|
||||
|
||||
PRE_CLEAN( "pre-clean" ),
|
||||
CLEAN( "clean" ),
|
||||
POST_CLEAN( "post-clean" ),
|
||||
|
||||
PRE_SITE( "pre-site" ),
|
||||
SITE( "site" ),
|
||||
POST_SITE( "post-site" ),
|
||||
SITE_DEPLOY( "site-deploy" ),
|
||||
|
||||
NONE( "" );
|
||||
|
||||
private final String id;
|
||||
|
||||
LifecyclePhase( String id )
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String id()
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).
|
||||
*
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention( RetentionPolicy.CLASS )
|
||||
@Target( ElementType.TYPE )
|
||||
@Inherited
|
||||
public @interface Mojo
|
||||
{
|
||||
/**
|
||||
* goal name (required).
|
||||
* @return the goal name
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* default phase to bind your mojo.
|
||||
* @return the default phase
|
||||
*/
|
||||
LifecyclePhase defaultPhase() default LifecyclePhase.NONE;
|
||||
|
||||
/**
|
||||
* the required dependency resolution scope.
|
||||
* @return the required dependency resolution scope
|
||||
*/
|
||||
ResolutionScope requiresDependencyResolution() default ResolutionScope.NONE;
|
||||
|
||||
/**
|
||||
* the required dependency collection scope.
|
||||
* @return the required dependency collection scope
|
||||
*/
|
||||
ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE;
|
||||
|
||||
/**
|
||||
* your Mojo instantiation strategy. (Only <code>per-lookup</code> and <code>singleton</code> are supported)
|
||||
* @return the instantiation strategy
|
||||
*/
|
||||
InstantiationStrategy instantiationStrategy() default InstantiationStrategy.PER_LOOKUP;
|
||||
|
||||
/**
|
||||
* execution strategy: <code>once-per-session</code> or <code>always</code>.
|
||||
* @return <code>once-per-session</code> or <code>always</code>
|
||||
*/
|
||||
String executionStrategy() default "once-per-session";
|
||||
|
||||
/**
|
||||
* does your mojo requires a project to be executed?
|
||||
* @return requires a project
|
||||
*/
|
||||
boolean requiresProject() default true;
|
||||
|
||||
/**
|
||||
* does your mojo requires a reporting context to be executed?
|
||||
* @return requires a reporting context
|
||||
*/
|
||||
boolean requiresReports() default false;
|
||||
|
||||
/**
|
||||
* if the Mojo uses the Maven project and its child modules.
|
||||
* @return uses the Maven project and its child modules
|
||||
*/
|
||||
boolean aggregator() default false;
|
||||
|
||||
/**
|
||||
* can this Mojo be invoked directly only?
|
||||
* @return invoked directly only
|
||||
*/
|
||||
boolean requiresDirectInvocation() default false;
|
||||
|
||||
/**
|
||||
* does this Mojo need to be online to be executed?
|
||||
* @return need to be online
|
||||
*/
|
||||
boolean requiresOnline() default false;
|
||||
|
||||
boolean inheritByDefault() default true;
|
||||
|
||||
/**
|
||||
* own configurator class.
|
||||
* @return own configurator class
|
||||
*/
|
||||
String configurator() default "";
|
||||
|
||||
/**
|
||||
* is your mojo thread safe (since Maven 3.x)?
|
||||
* @return is thread safe
|
||||
*/
|
||||
boolean threadSafe() default false;
|
||||
}
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Used to configure your Mojo parameters to be injected by
|
||||
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/MavenPluginManager.html">
|
||||
* <code>MavenPluginManager.getConfiguredMojo(...)</code></a>.
|
||||
*
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention( RetentionPolicy.CLASS )
|
||||
@Target( { ElementType.FIELD } )
|
||||
@Inherited
|
||||
public @interface Parameter
|
||||
{
|
||||
/**
|
||||
* name of the bean property used to get/set the field: by default, field name is used.
|
||||
* @return the name of the bean property
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* alias supported to get parameter value.
|
||||
* @return the alias
|
||||
*/
|
||||
String alias() default "";
|
||||
|
||||
/**
|
||||
* Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom
|
||||
* properties.
|
||||
* @return property name
|
||||
*/
|
||||
String property() default "";
|
||||
|
||||
/**
|
||||
* parameter default value, eventually containing <code>${...}</code> expressions which will be interpreted at
|
||||
* inject time: see
|
||||
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html">
|
||||
* PluginParameterExpressionEvaluator</a>.
|
||||
* @return the default value
|
||||
*/
|
||||
String defaultValue() default "";
|
||||
|
||||
/**
|
||||
* is the parameter required?
|
||||
* @return <code>true</code> if the Mojo should fail when the parameter cannot be injected
|
||||
*/
|
||||
boolean required() default false;
|
||||
|
||||
/**
|
||||
* Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified
|
||||
* configuration). This is useful when you want to force the user to use common POM elements rather than plugin
|
||||
* configurations, as in the case where you want to use the artifact's final name as a parameter. In this case, you
|
||||
* want the user to modify <code><build><finalName/></build></code> rather than specifying a value
|
||||
* for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a
|
||||
* List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
|
||||
*
|
||||
* @return <code>true</code> if the user should not be allowed to configure the parameter directly
|
||||
*/
|
||||
boolean readonly() default false;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package org.apache.maven.plugins.annotations;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* Dependencies resolution scopes available before
|
||||
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/lifecycle/internal/MojoExecutor.html">mojo execution</a>.
|
||||
*
|
||||
* @author Hervé Boutemy
|
||||
* @since 3.0
|
||||
*/
|
||||
public enum ResolutionScope
|
||||
{
|
||||
/**
|
||||
* empty resolution scope
|
||||
*/
|
||||
NONE( null ),
|
||||
/**
|
||||
* <code>compile</code> resolution scope
|
||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> dependencies
|
||||
*/
|
||||
COMPILE( Artifact.SCOPE_COMPILE ),
|
||||
/**
|
||||
* <code>compile+runtime</code> resolution scope (Maven 3 only)
|
||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> dependencies
|
||||
*/
|
||||
COMPILE_PLUS_RUNTIME( Artifact.SCOPE_COMPILE_PLUS_RUNTIME ),
|
||||
/**
|
||||
* <code>runtime</code> resolution scope
|
||||
* = <code>compile</code> + <code>runtime</code> dependencies
|
||||
*/
|
||||
RUNTIME( Artifact.SCOPE_RUNTIME ),
|
||||
/**
|
||||
* <code>runtime+system</code> resolution scope (Maven 3 only)
|
||||
* = <code>compile</code> + <code>system</code> + <code>runtime</code> dependencies
|
||||
*/
|
||||
RUNTIME_PLUS_SYSTEM( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM ),
|
||||
/**
|
||||
* <code>test</code> resolution scope
|
||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> + <code>test</code>
|
||||
* dependencies
|
||||
*/
|
||||
TEST( Artifact.SCOPE_TEST );
|
||||
|
||||
private final String id;
|
||||
|
||||
ResolutionScope( String id )
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String id()
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
------
|
||||
About ${project.name}
|
||||
------
|
||||
Hervé Boutemy
|
||||
------
|
||||
2012-06-03
|
||||
------
|
||||
|
||||
~~ 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.
|
||||
|
||||
~~ NOTE: For help with the syntax of this file, see:
|
||||
~~ http://maven.apache.org/doxia/references/apt-format.html
|
||||
|
||||
About ${project.name}
|
||||
|
||||
${project.description}
|
||||
|
||||
* Usage
|
||||
|
||||
To be able to {{{../maven-plugin-tools-annotations/index.html}use Maven Plugin Tools Java 5 Annotations}},
|
||||
some configuration has to be done in <<<pom.xml>>>: see
|
||||
{{{../maven-plugin-plugin/examples/using-annotations.html#POM_configuration} Using Plugin Tools Java5 Annotations}}
|
||||
example in {{{../maven-plugin-plugin} <<<maven-plugin-plugin>>>}} documentation.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
|
||||
<body>
|
||||
<menu name="Overview">
|
||||
<item name="Introduction" href="index.html"/>
|
||||
<item name="JavaDocs" href="apidocs/index.html"/>
|
||||
<item name="Source Xref" href="xref/index.html"/>
|
||||
<!--item name="FAQ" href="faq.html"/-->
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
|
|
@ -17,17 +17,18 @@
|
|||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugins</artifactId>
|
||||
<version>11</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Plugin Plugin</name>
|
||||
|
|
@ -37,49 +38,72 @@
|
|||
plugin registry, the artifact metadata and a generic help goal.
|
||||
</description>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-tools/tags/maven-plugin-tools-2.4.3/maven-plugin-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-tools/tags/maven-plugin-tools-2.4.3/maven-plugin-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/viewvc/maven/plugin-tools/tags/maven-plugin-tools-2.4.3/maven-plugin-plugin</url>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>jira</system>
|
||||
<url>http://jira.codehaus.org/browse/MPLUGIN</url>
|
||||
</issueManagement>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache.website</id>
|
||||
<url>scp://people.apache.org/www/maven.apache.org/plugins/maven-plugin-plugin</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<prerequisites>
|
||||
<maven>2.2.1</maven>
|
||||
<maven>2.0.6</maven>
|
||||
</prerequisites>
|
||||
|
||||
<properties>
|
||||
<doxiaVersion>1.4</doxiaVersion>
|
||||
<doxia-sitetoolsVersion>1.4</doxia-sitetoolsVersion>
|
||||
<it.debug>true</it.debug>
|
||||
<doxiaVersion>1.0-alpha-10</doxiaVersion>
|
||||
<doxia-sitetoolsVersion>1.0-alpha-10</doxia-sitetoolsVersion>
|
||||
<pluginToolsVersion>2.4.3</pluginToolsVersion>
|
||||
</properties>
|
||||
|
||||
<!-- Copy from project up -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- maven -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
<version>${pluginToolsVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-model</artifactId>
|
||||
<version>${pluginToolsVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
<version>${pluginToolsVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||
<version>${pluginToolsVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-descriptor</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- plexus -->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>1.5.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-generators</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- runtime extractors used by default by plugin-tools -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- for source code annotations of the mojos -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<!-- from stricter view, should use ${mavenPluginToolsVersion} but this is causing problems with release plugin -->
|
||||
<!--version>${mavenPluginToolsVersion}</version-->
|
||||
<!--
|
||||
Do not use 'provided' scope here. The annotations are a transitive dependency of
|
||||
'maven-plugin-tools-annotations' which fails to load at runtime when not available.
|
||||
-->
|
||||
</dependency>
|
||||
|
||||
<!-- doxia -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.doxia</groupId>
|
||||
|
|
@ -102,53 +126,72 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Maven -->
|
||||
<!-- maven -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-repository-metadata</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-descriptor</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-registry</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact-manager</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- shared -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.reporting</groupId>
|
||||
<artifactId>maven-reporting-impl</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>2.0.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.reporting</groupId>
|
||||
<artifactId>maven-reporting-api</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Maven runtime -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- plexus -->
|
||||
|
|
@ -156,74 +199,41 @@
|
|||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-velocity</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- other -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- needed for it tests -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script-beanshell</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script-ant</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/filtered-resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- pin to a previous version so it doesn't get reloaded during build -->
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes combine.children="append">
|
||||
<!-- This file should exactly match the output of this project -->
|
||||
<exclude>src/it/help-basic/expected-help.txt</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generated-helpmojo</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-18</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
|
@ -238,71 +248,14 @@
|
|||
</models>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<id>ensure-no-container-api</id>
|
||||
<configuration>
|
||||
<rules>
|
||||
<bannedDependencies>
|
||||
<excludes>
|
||||
<exclude>org.codehaus.plexus:plexus-component-api</exclude>
|
||||
</excludes>
|
||||
<message>The new containers are not supported. You probably added a dependency that is missing the exclusions.</message>
|
||||
</bannedDependencies>
|
||||
</rules>
|
||||
<fail>true</fail>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.5</version>
|
||||
<!-- will use previous maven-plugin-plugin release to build current maven-plugin-plugin as configured in parent -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-descriptor</id>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generated-helpmojo</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.3</version><!-- cannot use ${mavenPluginToolsVersion} property because release plugin would try to update -->
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>report</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>${mavenInvokerPluginVersion}</version>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
|
@ -312,34 +265,28 @@
|
|||
<id>reporting</id>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>${mavenInvokerPluginVersion}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>l10n-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<version>1.0-alpha-1</version>
|
||||
<configuration>
|
||||
<locales>
|
||||
<locale>de</locale>
|
||||
<locale>fr</locale>
|
||||
<locale>sv</locale>
|
||||
</locales>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-changes-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<version>2.0</version>
|
||||
<configuration>
|
||||
<!-- For JIRA-report -->
|
||||
<columnNames>Type,Key,Summary,Assignee,Status,Resolution,Fix Version</columnNames>
|
||||
<maxEntries>200</maxEntries>
|
||||
<onlyCurrentVersion>true</onlyCurrentVersion>
|
||||
<resolutionIds>Closed</resolutionIds>
|
||||
<sortColumnNames>Type,Key</sortColumnNames>
|
||||
<component>13021</component>
|
||||
</configuration>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
|
|
@ -349,75 +296,183 @@
|
|||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>run-its</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>${mavenInvokerPluginVersion}</version>
|
||||
<configuration>
|
||||
<debug>${it.debug}</debug>
|
||||
<projectsDirectory>src/it</projectsDirectory>
|
||||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
|
||||
<preBuildHookScript>setup</preBuildHookScript>
|
||||
<postBuildHookScript>verify</postBuildHookScript>
|
||||
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
|
||||
<settingsFile>src/it/settings.xml</settingsFile>
|
||||
<filterProperties>
|
||||
<sitePluginVersion>3.3</sitePluginVersion>
|
||||
<antVersion>${antVersion}</antVersion>
|
||||
</filterProperties>
|
||||
<properties>
|
||||
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
|
||||
</properties>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<goals>
|
||||
<goal>install</goal>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>maven-2</id>
|
||||
<activation>
|
||||
<file>
|
||||
<!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
|
||||
<missing>${basedir}</missing>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</plugin>
|
||||
<!-- TODO: remove when maven-plugins parent pom 12 is released -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- see https://issues.apache.org/jira/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
<taglets>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
|
||||
<taglet>
|
||||
<tagletClass>org.codehaus.plexus.javadoc.PlexusComponentTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-javadoc</artifactId>
|
||||
<version>1.0</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.codehaus.plexus.javadoc.PlexusConfigurationTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-javadoc</artifactId>
|
||||
<version>1.0</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
<taglet>
|
||||
<tagletClass>org.codehaus.plexus.javadoc.PlexusRequirementTaglet</tagletClass>
|
||||
<tagletArtifact>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-javadoc</artifactId>
|
||||
<version>1.0</version>
|
||||
</tagletArtifact>
|
||||
</taglet>
|
||||
</taglets>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</reporting>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = install
|
||||
invoker.goals.2 = org.apache.maven.its.annotation-with-inheritance-from-deps:annotation-with-inheritance-from-deps:1.0-SNAPSHOT:first
|
||||
invoker.goals.3 = org.apache.maven.its.annotation-with-inheritance-from-deps:annotation-with-inheritance-from-deps:1.0-SNAPSHOT:help
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance-from-deps</groupId>
|
||||
<artifactId>annotation-with-inheritance-from-deps</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test :: annotation-with-inheritance-from-deps</name>
|
||||
<description>
|
||||
Test plugin-plugin, which tests maven-plugin-tools-api and
|
||||
maven-plugin-tools-java. This will generate a plugin descriptor from
|
||||
java-based mojo sources, install the plugin, and then use it.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<plexusCompilerVersion>1.8.6</plexusCompilerVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>@mavenVersion@</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-manager</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-javac</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.FooMojo;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "first", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
public class FirstMojo
|
||||
extends FooMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class )// , roleHint = "default"
|
||||
private Object projectHelper;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
if ( bar == null )
|
||||
{
|
||||
throw new MojoExecutionException( "bar == null" );
|
||||
}
|
||||
if ( beer == null )
|
||||
{
|
||||
throw new MojoExecutionException( "beer == null" );
|
||||
}
|
||||
if ( projectHelper == null )
|
||||
{
|
||||
throw new MojoExecutionException( "projectHelper == null" );
|
||||
}
|
||||
if ( compilerManager == null )
|
||||
{
|
||||
throw new MojoExecutionException( "compilerManager == null" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<lifecycles>
|
||||
<lifecycle>
|
||||
<id>my-lifecycle</id>
|
||||
<phases>
|
||||
<phase>
|
||||
<id>process-classes</id>
|
||||
</phase>
|
||||
<phase>
|
||||
<id>test</id>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.directory}/generated-classes/cobertura</classesDirectory>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</phase>
|
||||
</phases>
|
||||
</lifecycle>
|
||||
</lifecycles>
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
File oldHelpClass = new File( basedir, "target/classes/HelpMojo.class" );
|
||||
assert !oldHelpClass.exists()
|
||||
|
||||
File newHelpClass = new File( basedir, "target/classes/org/apache/maven/plugin/coreit/HelpMojo.class" );
|
||||
assert newHelpClass.exists()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'first'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Touches a test file.'
|
||||
assert mojo.deprecated.text() == "Don't use!"
|
||||
assert mojo.requiresDependencyResolution.text() == 'test'
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == 'integration-test'
|
||||
assert mojo.executePhase.text() == 'package'
|
||||
assert mojo.executeLifecycle.text() == 'my-lifecycle'
|
||||
|
||||
assert mojo.configuration.bar[0].text() == '${thebar}'
|
||||
assert mojo.configuration.bar[0].'@implementation' == 'java.lang.String'
|
||||
assert mojo.configuration.bar[0].'@default-value' == 'coolbar'
|
||||
|
||||
assert mojo.configuration.beer[0].text() == '${thebeer}'
|
||||
assert mojo.configuration.beer[0].'@implementation' == 'java.lang.String'
|
||||
assert mojo.configuration.beer[0].'@default-value' == 'coolbeer'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 3
|
||||
|
||||
assert mojo.requirements.requirement[1].role.text() == 'org.codehaus.plexus.compiler.manager.CompilerManager'
|
||||
assert mojo.requirements.requirement[1].'role-hint'.text() == ''
|
||||
assert mojo.requirements.requirement[1].'field-name'.text() == 'compilerManager'
|
||||
|
||||
assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
|
||||
assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 3
|
||||
|
||||
def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam"}[0]
|
||||
|
||||
assert parameter.name.text() == 'aliasedParam'
|
||||
assert parameter.alias.text() == 'alias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == 'As of 0.2'
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "beer"}[0]
|
||||
|
||||
assert parameter.name.text() == 'beer'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == "wine is better"
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == 'beer for non french folks'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "bar"}[0]
|
||||
|
||||
assert parameter.name.text() == 'bar'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == 'the cool bar to go'
|
||||
|
||||
return true;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.annotation-with-inheritance-reactor:module-mojo:1.0-SNAPSHOT:it0014
|
||||
invoker.goals.3 = org.apache.maven.its.annotation-with-inheritance-reactor:module-mojo:1.0-SNAPSHOT:first
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance-reactor</groupId>
|
||||
<artifactId>annotation-with-inheritance-reactor</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>module-abstract-mojo</artifactId>
|
||||
</project>
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
package org.apache.maven.plugins;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.codehaus.plexus.compiler.manager.CompilerManager;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractFirstMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* Project directory.
|
||||
*/
|
||||
@Parameter( defaultValue = "${basedir}", readonly = true )
|
||||
protected File basedir;
|
||||
|
||||
@Parameter( property = "first.touchFile", defaultValue = "${project.build.directory}/touch.txt",
|
||||
required = true )
|
||||
protected File touchFile;
|
||||
|
||||
/**
|
||||
* Plexus compiler manager.
|
||||
*/
|
||||
@Component
|
||||
protected CompilerManager compilerManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Component( role = ArtifactMetadataSource.class, hint = "maven" )
|
||||
protected ArtifactMetadataSource artifactMetadataSource;
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance-reactor</groupId>
|
||||
<artifactId>annotation-with-inheritance-reactor</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>module-mojo</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance-reactor</groupId>
|
||||
<artifactId>module-abstract-mojo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "it0014" )
|
||||
public class CoreIt0014Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( property = "project.build.directory", required = true )
|
||||
private String outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "outputDirectory = " + outputDirectory );
|
||||
|
||||
File f = new File( outputDirectory );
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
try
|
||||
{
|
||||
touch.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error writing verification file.", e );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.plugins.AbstractFirstMojo;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "first", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
@Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" )
|
||||
public class FirstMojo
|
||||
extends AbstractFirstMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class )
|
||||
private Object projectHelper;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
if ( basedir == null )
|
||||
{
|
||||
throw new MojoExecutionException( "basedir == null" );
|
||||
}
|
||||
if ( touchFile == null )
|
||||
{
|
||||
throw new MojoExecutionException( "touchFile == null" );
|
||||
}
|
||||
if ( projectHelper == null )
|
||||
{
|
||||
throw new MojoExecutionException( "projectHelper == null" );
|
||||
}
|
||||
if ( compilerManager == null )
|
||||
{
|
||||
throw new MojoExecutionException( "compilerManager == null" );
|
||||
}
|
||||
if (! ( projectHelper instanceof MavenProjectHelper ))
|
||||
{
|
||||
throw new MojoExecutionException( "! projectHelper instanceof MavenProjectHelper" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
|
||||
/**
|
||||
* Does nothing special.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "second", requiresDependencyCollection = ResolutionScope.COMPILE, threadSafe = true )
|
||||
public class SecondMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<lifecycles>
|
||||
<lifecycle>
|
||||
<id>cobertura</id>
|
||||
<phases>
|
||||
<phase>
|
||||
<id>process-classes</id>
|
||||
</phase>
|
||||
<phase>
|
||||
<id>test</id>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.directory}/generated-classes/cobertura</classesDirectory>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</phase>
|
||||
</phases>
|
||||
</lifecycle>
|
||||
</lifecycles>
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance-reactor</groupId>
|
||||
<artifactId>annotation-with-inheritance-reactor</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>Maven Integration Test :: annotation-with-inheritance</name>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>module-abstract-mojo</module>
|
||||
<module>module-mojo</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<plexusCompilerVersion>1.8.6</plexusCompilerVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>@mavenVersion@</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-manager</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-javac</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "module-mojo/target/touch.txt" )
|
||||
assert touchFile.isFile()
|
||||
|
||||
File descriptorFile = new File( basedir, "module-mojo/target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
assert pluginDescriptor.mojos.mojo.size() == 3
|
||||
|
||||
def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'first'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Touches a test file.'
|
||||
assert mojo.deprecated.text() == "Don't use!"
|
||||
assert mojo.requiresDependencyResolution.text() == 'test'
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == 'integration-test'
|
||||
assert mojo.executePhase.text() == 'generate-sources'
|
||||
assert mojo.executeLifecycle.text() == 'cobertura'
|
||||
|
||||
assert mojo.configuration.basedir[0].text() == ''
|
||||
assert mojo.configuration.basedir[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.basedir[0].'@default-value' == '${basedir}'
|
||||
|
||||
assert mojo.configuration.touchFile[0].text() == '${first.touchFile}'
|
||||
assert mojo.configuration.touchFile[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.touchFile[0].'@default-value' == '${project.build.directory}/touch.txt'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 3
|
||||
|
||||
assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
|
||||
assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 3
|
||||
|
||||
def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam"}[0]
|
||||
|
||||
assert parameter.name.text() == 'aliasedParam'
|
||||
assert parameter.alias.text() == 'alias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == 'As of 0.2'
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile"}[0]
|
||||
|
||||
assert parameter.name.text() == 'touchFile'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir"}[0]
|
||||
|
||||
assert parameter.name.text() == 'basedir'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Project directory.'
|
||||
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second"}[0]
|
||||
|
||||
assert mojo.requiresDependencyCollection.text() == 'compile'
|
||||
assert mojo.threadSafe.text() == 'true'
|
||||
|
||||
return true;
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.annotation-with-inheritance:annotation-with-inheritance:1.0-SNAPSHOT:it0014
|
||||
invoker.goals.3 = org.apache.maven.its.annotation-with-inheritance:annotation-with-inheritance:1.0-SNAPSHOT:first
|
||||
invoker.goals.4 = org.apache.maven.its.annotation-with-inheritance:annotation-with-inheritance:1.0-SNAPSHOT:help
|
||||
invoker.goals.5 = org.apache.maven.its.annotation-with-inheritance:annotation-with-inheritance:1.0-SNAPSHOT:third
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.annotation-with-inheritance</groupId>
|
||||
<artifactId>annotation-with-inheritance</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test :: annotation-with-inheritance</name>
|
||||
<description>
|
||||
Test plugin-plugin, which tests maven-plugin-tools-api and
|
||||
maven-plugin-tools-java. This will generate a plugin descriptor from
|
||||
java-based mojo sources, install the plugin, and then use it.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<plexusCompilerVersion>1.8.6</plexusCompilerVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>@mavenVersion@</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-manager</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-javac</artifactId>
|
||||
<version>${plexusCompilerVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-component-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-exec</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.codehaus.plexus.compiler.manager.CompilerManager;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractFirstMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* Project directory.
|
||||
*/
|
||||
@Parameter( defaultValue = "${basedir}", readonly = true )
|
||||
protected File basedir;
|
||||
|
||||
@Parameter( property = "first.touchFile", defaultValue = "${project.build.directory}/touch.txt",
|
||||
required = true )
|
||||
protected File touchFile;
|
||||
|
||||
/**
|
||||
* Plexus compiler manager.
|
||||
*/
|
||||
@Component
|
||||
protected CompilerManager compilerManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Component( role = ArtifactMetadataSource.class, hint = "maven" )
|
||||
protected ArtifactMetadataSource artifactMetadataSource;
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.codehaus.plexus.compiler.manager.CompilerManager;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractFooMojo
|
||||
extends AbstractFirstMojo
|
||||
{
|
||||
|
||||
// MPLUGIN-206
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "it0014" )
|
||||
public class CoreIt0014Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( property = "project.build.directory", required = true )
|
||||
private String outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "outputDirectory = " + outputDirectory );
|
||||
|
||||
File f = new File( outputDirectory );
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
try
|
||||
{
|
||||
touch.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error writing verification file.", e );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "first", requiresDependencyResolution = ResolutionScope.COMPILE,
|
||||
defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
@Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" )
|
||||
public class FirstMojo
|
||||
extends AbstractFirstMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class )//, roleHint = "default"
|
||||
private Object projectHelper;
|
||||
|
||||
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||
private Set<Artifact> dependencies;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
if ( basedir == null )
|
||||
{
|
||||
throw new MojoExecutionException( "basedir == null" );
|
||||
}
|
||||
if ( touchFile == null )
|
||||
{
|
||||
throw new MojoExecutionException( "touchFile == null" );
|
||||
}
|
||||
if ( projectHelper == null )
|
||||
{
|
||||
throw new MojoExecutionException( "projectHelper == null" );
|
||||
}
|
||||
if ( compilerManager == null )
|
||||
{
|
||||
throw new MojoExecutionException( "compilerManager == null" );
|
||||
}
|
||||
|
||||
if ( dependencies.isEmpty() )
|
||||
{
|
||||
throw new MojoExecutionException( "dependencies.isEmpty()" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
|
||||
/**
|
||||
* Does nothing special.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "second", requiresDependencyCollection = ResolutionScope.COMPILE, threadSafe = true )
|
||||
public class SecondMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "third", requiresDependencyResolution = ResolutionScope.COMPILE,
|
||||
defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
@Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" )
|
||||
public class ThirdMojo
|
||||
extends AbstractFooMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class )//, roleHint = "default"
|
||||
private Object projectHelper;
|
||||
|
||||
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||
private Set<Artifact> dependencies;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
if ( basedir == null )
|
||||
{
|
||||
throw new MojoExecutionException( "basedir == null" );
|
||||
}
|
||||
if ( touchFile == null )
|
||||
{
|
||||
throw new MojoExecutionException( "touchFile == null" );
|
||||
}
|
||||
if ( projectHelper == null )
|
||||
{
|
||||
throw new MojoExecutionException( "projectHelper == null" );
|
||||
}
|
||||
if ( compilerManager == null )
|
||||
{
|
||||
throw new MojoExecutionException( "compilerManager == null" );
|
||||
}
|
||||
|
||||
if ( dependencies.isEmpty() )
|
||||
{
|
||||
throw new MojoExecutionException( "dependencies.isEmpty()" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<lifecycles>
|
||||
<lifecycle>
|
||||
<id>cobertura</id>
|
||||
<phases>
|
||||
<phase>
|
||||
<id>process-classes</id>
|
||||
</phase>
|
||||
<phase>
|
||||
<id>test</id>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.directory}/generated-classes/cobertura</classesDirectory>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</phase>
|
||||
</phases>
|
||||
</lifecycle>
|
||||
</lifecycles>
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "target/touch.txt" )
|
||||
assert touchFile.isFile()
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
File oldHelpClass = new File( basedir, "target/classes/HelpMojo.class" );
|
||||
assert !oldHelpClass.exists()
|
||||
|
||||
File newHelpClass = new File( basedir, "target/classes/org/apache/maven/plugin/coreit/HelpMojo.class" );
|
||||
assert newHelpClass.exists()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first" }[0]
|
||||
|
||||
assert mojo.goal.text() == 'first'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Touches a test file.'
|
||||
assert mojo.deprecated.text() == "Don't use!"
|
||||
assert mojo.requiresDependencyResolution.text() == 'compile'
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == 'integration-test'
|
||||
assert mojo.executePhase.text() == 'generate-sources'
|
||||
assert mojo.executeLifecycle.text() == 'cobertura'
|
||||
|
||||
assert mojo.configuration.basedir[0].text() == ''
|
||||
assert mojo.configuration.basedir[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.basedir[0].'@default-value' == '${basedir}'
|
||||
|
||||
assert mojo.configuration.touchFile[0].text() == '${first.touchFile}'
|
||||
assert mojo.configuration.touchFile[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.touchFile[0].'@default-value' == '${project.build.directory}/touch.txt'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 3
|
||||
|
||||
assert mojo.requirements.requirement[2].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
//assert mojo.requirements.requirement[2].'role-hint'.text() == 'default'
|
||||
assert mojo.requirements.requirement[2].'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 4
|
||||
|
||||
def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam"}[0]
|
||||
|
||||
assert parameter.name.text() == 'aliasedParam'
|
||||
assert parameter.alias.text() == 'alias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == 'As of 0.2'
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile"}[0]
|
||||
|
||||
assert parameter.name.text() == 'touchFile'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir"}[0]
|
||||
|
||||
assert parameter.name.text() == 'basedir'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Project directory.'
|
||||
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second"}[0]
|
||||
|
||||
assert mojo.requiresDependencyCollection.text() == 'compile'
|
||||
assert mojo.threadSafe.text() == 'true'
|
||||
|
||||
return true;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.ant.it:maven-ant-it-basic:1.0-SNAPSHOT:touch -Dname=touch.txt
|
||||
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "target/touch.txt" )
|
||||
assert touchFile.isFile()
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
File oldHelpClass = new File( basedir, "target/classes/HelpMojo.class" );
|
||||
assert !oldHelpClass.exists()
|
||||
|
||||
|
||||
return true;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.ant.it:maven-ant-it-referenceParameter:1.0-SNAPSHOT:test
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
#invoker.goals.2 = org.apache.maven.ant.it:maven-ant-it-referenceParameter:1.0-SNAPSHOT:test
|
||||
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>test</groupId>
|
||||
<artifactId>trivial-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<version>1.0</version>
|
||||
<name>trivial-maven-plugin</name>
|
||||
<description>Just a test project</description>
|
||||
<url>http://nowere.test</url>
|
||||
<inceptionYear>2012</inceptionYear>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-ant</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project name="ant-tasks">
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<!-- Global Properties -->
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<!-- taskdef resource="net/sf/antcontrib/antcontrib.properties"/-->
|
||||
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<!-- Main task -->
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<target name="sample-task">
|
||||
|
||||
<echo message="${message}."/>
|
||||
|
||||
</target>
|
||||
</project>
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<pluginMetadata
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/PLUGIN-METADATA/1.1.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/PLUGIN-METADATA/1.1.0 http://maven.apache.org/xsd/plugin-metadata-1.1.0.xsd">
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>sample</goal>
|
||||
<call>sample-task</call>
|
||||
<description>Just a test</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>false</requiresProject>
|
||||
<since>1.0</since>
|
||||
<parameters>
|
||||
|
||||
<parameter>
|
||||
<name>message</name>
|
||||
<type>java.lang.String</type>
|
||||
<required>true</required>
|
||||
<readonly>true</readonly>
|
||||
<since>1.0</since>
|
||||
<description>Test param</description>
|
||||
</parameter>
|
||||
|
||||
</parameters>
|
||||
</mojo>
|
||||
</mojos>
|
||||
</pluginMetadata>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.beanshell.it:maven-beanshell-it-basic:1.0-SNAPSHOT:touch -Dname=touch.txt
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.beanshell.it</groupId>
|
||||
<artifactId>maven-beanshell-it-basic</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Basic Beanshell-Mojo Integration Test</name>
|
||||
|
||||
<properties>
|
||||
<pluginPluginVersion>@project.version@</pluginPluginVersion><!-- -->
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>bsh</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script-beanshell</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>${pluginPluginVersion}</version>
|
||||
<configuration>
|
||||
<prefix>beanshellBasic</prefix>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||
<version>${pluginPluginVersion}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// START SNIPPET: beanshell-mojo
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @goal touch
|
||||
* @requiresDependencyResolution=test
|
||||
* @deprecated Don't use!
|
||||
* @since 1.2
|
||||
*/
|
||||
|
||||
import org.apache.maven.plugin.Mojo;
|
||||
import org.apache.maven.script.beanshell.BeanshellMojoAdapter;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
|
||||
|
||||
|
||||
execute()
|
||||
{
|
||||
logger.info( "Executing beanshell mojo..." );
|
||||
FileUtils.fileWrite( outDir + "/" + name, "This is a Beanshell test" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Output directory for files.
|
||||
*
|
||||
* @parameter expression="${project.build.directory}"
|
||||
* @required
|
||||
*/
|
||||
setOutDir( file )
|
||||
{
|
||||
outDir = file;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @parameter expression="${name}"
|
||||
* @required
|
||||
*/
|
||||
setName( name )
|
||||
{
|
||||
name = name;
|
||||
}
|
||||
|
||||
return new BeanshellMojoAdapter( (Mojo) this, this.interpreter );
|
||||
// END SNIPPET: beanshell-mojo
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "target/touch.txt" )
|
||||
assert touchFile.exists()
|
||||
assert touchFile.isFile()
|
||||
content = touchFile.text
|
||||
assert content.contains('This is a Beanshell test');
|
||||
|
||||
|
||||
return true;
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>test</groupId>
|
||||
<artifactId>maven-since-3.x</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>test</groupId>
|
||||
<artifactId>antsample-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<name>ANT Sample</name>
|
||||
<description>Just a test project</description>
|
||||
<url>http://nowere.test</url>
|
||||
<inceptionYear>2012</inceptionYear>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-ant</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project name="ant-tasks">
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<!-- Global Properties -->
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<!-- taskdef resource="net/sf/antcontrib/antcontrib.properties"/-->
|
||||
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<!-- Main task -->
|
||||
<!-- +++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
<target name="sample-task">
|
||||
|
||||
<echo message="${message}."/>
|
||||
|
||||
</target>
|
||||
</project>
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<pluginMetadata
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/PLUGIN-METADATA/1.1.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/PLUGIN-METADATA/1.1.0 http://maven.apache.org/xsd/plugin-metadata-1.1.0.xsd">
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>sample</goal>
|
||||
<call>sample-task</call>
|
||||
<description>Just a test</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>false</requiresProject>
|
||||
<since>1.0</since>
|
||||
<parameters>
|
||||
|
||||
<parameter>
|
||||
<name>message</name>
|
||||
<type>java.lang.String</type>
|
||||
<required>true</required>
|
||||
<readonly>false</readonly>
|
||||
<since>0.9</since>
|
||||
<description>Test param</description>
|
||||
</parameter>
|
||||
|
||||
</parameters>
|
||||
</mojo>
|
||||
</mojos>
|
||||
</pluginMetadata>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project name="${artifactId}">
|
||||
<publishDate position="right" format="dd/MM/yyyy, HH:mm" />
|
||||
<version position="right"/>
|
||||
<poweredBy>
|
||||
<logo name="Maven" href="http://maven.apache.org/"
|
||||
img="${project.url}/images/maven-feather.png" />
|
||||
</poweredBy>
|
||||
<body>
|
||||
<menu name="Overview">
|
||||
<item name="Introduction" href="index.html"/>
|
||||
<item name="Goals" href="plugin-info.html"/>
|
||||
<item name="Usage" href="usage.html"/>
|
||||
<item name="FAQ" href="faq.html"/>
|
||||
</menu>
|
||||
${reports}
|
||||
</body>
|
||||
</project>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install site
|
||||
invoker.maven.version = 3.0+
|
||||
|
||||
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>test</groupId>
|
||||
<artifactId>maven-since-3.x</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>test</groupId>
|
||||
<artifactId>javasample-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Java Sample</name>
|
||||
<description>Java Maven Mojo.</description>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*
|
||||
* @goal touch
|
||||
* @since 1.0
|
||||
*
|
||||
* @phase process-sources
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
* @parameter property="project.build.directory"
|
||||
* @required
|
||||
*/
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project name="${artifactId}">
|
||||
<publishDate position="right" format="dd/MM/yyyy, HH:mm" />
|
||||
<version position="right"/>
|
||||
<poweredBy>
|
||||
<logo name="Maven" href="http://maven.apache.org/"
|
||||
img="${project.url}/images/maven-feather.png" />
|
||||
</poweredBy>
|
||||
<body>
|
||||
<menu name="Overview">
|
||||
<item name="Introduction" href="index.html"/>
|
||||
<item name="Goals" href="plugin-info.html"/>
|
||||
<item name="Usage" href="usage.html"/>
|
||||
<item name="FAQ" href="faq.html"/>
|
||||
</menu>
|
||||
${reports}
|
||||
</body>
|
||||
</project>
|
||||
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>test</groupId>
|
||||
<artifactId>maven-since-3.x</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Samples</name>
|
||||
<packaging>pom</packaging>
|
||||
<description>Just a test project</description>
|
||||
<url>http://nowere.test</url>
|
||||
<inceptionYear>2012</inceptionYear>
|
||||
|
||||
<modules>
|
||||
<module>antsample-maven-plugin</module>
|
||||
<module>javasample-maven-plugin</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generated-helpmojo</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-ant</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>@sitePluginVersion@</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-help-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<excludeDefaults>true</excludeDefaults>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "antsample-maven-plugin/target/site/sample-mojo.html" )
|
||||
assert touchFile.exists()
|
||||
assert touchFile.isFile()
|
||||
content = touchFile.text
|
||||
assert content.contains('Since');
|
||||
|
||||
|
||||
return true;
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
[INFO] help 1.0-SNAPSHOT
|
||||
Tests generation and compilation of the help mojo.
|
||||
|
||||
help:test
|
||||
Deprecated. As of 1.0, use the "quoted" goal instead.
|
||||
|
||||
MOJO-DESCRIPTION. Some 'quotation' marks and backslashes '\\', some important
|
||||
javadoc
|
||||
and an inline link to AnotherMojo.
|
||||
|
||||
Available parameters:
|
||||
|
||||
defaultParam (Default: escape\backslash)
|
||||
This parameter uses 'quotation' marks and backslashes '\\' in its
|
||||
description. Those characters must be escaped in Java string literals.
|
||||
|
||||
deprecatedParam
|
||||
Deprecated. As of version 1.0, use the {@link #defaultParam} instead.
|
||||
|
||||
This parameter is deprecated.
|
||||
|
||||
undocumentedParam
|
||||
|
||||
Required: Yes
|
||||
User property: test.undocumented
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.maven.version = 3.0+
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
invoker.goals.3 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
# --log-file option is only supported by Maven 3
|
||||
invoker.maven.version = 3.0+
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>help</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>
|
||||
Tests generation and compilation of the help mojo.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-descriptor</id>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
/**
|
||||
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
|
||||
* inline link to {@link test.AnotherMojo}.
|
||||
*
|
||||
* @deprecated As of 1.0, use the "quoted" goal instead.
|
||||
* @since 2.1
|
||||
*/
|
||||
@Mojo( name= "test" )
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
|
||||
* escaped in Java string literals.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@Parameter( defaultValue = "escape\\backslash" )
|
||||
private String defaultParam;
|
||||
|
||||
/**
|
||||
* This parameter is deprecated.
|
||||
*
|
||||
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
||||
*/
|
||||
@Parameter
|
||||
private String deprecatedParam;
|
||||
|
||||
@Parameter( property = "test.undocumented", required = true )
|
||||
private String undocumentedParam;
|
||||
|
||||
/**
|
||||
* Readonly parameter: should not be proposed for configuration.
|
||||
*/
|
||||
@Parameter( defaultValue = "not for configuration", readonly = true )
|
||||
private String readonly;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# 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.
|
||||
|
||||
detail = true
|
||||
goal = test
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r", "" );
|
||||
|
||||
log = new File( basedir, "help.log" ).text.replace( "\r", "" );
|
||||
log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) );
|
||||
log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim();
|
||||
|
||||
assert log == expected;
|
||||
|
||||
return true;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals = clean compile
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>help-package</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>
|
||||
Tests generation of the help mojo in a user-specified package (MPLUGIN-168).
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<helpPackageName>test.help</helpPackageName>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
|
||||
/**
|
||||
* MOJO-DESCRIPTION.
|
||||
*
|
||||
* @goal test
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* 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.io.*;
|
||||
|
||||
File helpMojo = new File( basedir, "target/classes/test/help/HelpMojo.class" );
|
||||
if ( !helpMojo.isFile() )
|
||||
{
|
||||
throw new FileNotFoundException( "Missing/misplaced: " + helpMojo );
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ipcr-dep-a</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dependency A</name>
|
||||
<description>
|
||||
Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class
|
||||
realm while traversing the class hierarchy (see QDOX-148). This module provides a simple dependency to build up
|
||||
the class realm of interest.
|
||||
</description>
|
||||
</project>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
public class ClassA
|
||||
{
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ipcr-dep-b</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dependency B</name>
|
||||
<description>
|
||||
Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class
|
||||
realm while traversing the class hierarchy (see QDOX-148). This module provides a simple dependency to build up
|
||||
the class realm of interest.
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr-dep-a</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
public class ClassB
|
||||
{
|
||||
|
||||
/**
|
||||
* For the test we want to trigger a linkage error when resolving ClassA. However, we want this error to occur when
|
||||
* analyzing ClassB and not when loading ClassB itself.
|
||||
*/
|
||||
public void triggerLazyLinkageError(ClassA param)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.profiles.1 = setup
|
||||
|
||||
invoker.goals.2 = clean process-classes
|
||||
invoker.profiles.2 = test
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Aggregator</name>
|
||||
<description>
|
||||
Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class
|
||||
realm while traversing the class hierarchy (see QDOX-148).
|
||||
</description>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<!-- builds the dependencies requires to exhibit the problem -->
|
||||
<id>setup</id>
|
||||
<modules>
|
||||
<module>dep-a</module>
|
||||
<module>dep-b</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- runs the test -->
|
||||
<id>test</id>
|
||||
<modules>
|
||||
<module>test</module>
|
||||
</modules>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ipcr-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Test Plugin</name>
|
||||
<description>
|
||||
Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class
|
||||
realm while traversing the class hierarchy (see QDOX-148). This module provides the plugin sources to scan.
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!--
|
||||
This project depends on both ipcr-dep-b and (indirectly) ipcr-dep-a. However, the plugin realm only contains
|
||||
ipcr-dep-b, causing a linkage error when erroneously traversing the class hierarchy.
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr-dep-b</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr-dep-b</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.its.plugin</groupId>
|
||||
<artifactId>ipcr-dep-a</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is the source class to be scanned for annotations. While scanning, QDox must not try to resolve references to
|
||||
* other types like the super class from the plugin class realm. The plugin class realm has no relation at all to
|
||||
* the project class path. In particular, the plugin class realm could (by incident) contain different versions of those
|
||||
* types or could be incomplete (due to exclusions). The later case leads to NoClassDefFoundErrors, crashing the scan.
|
||||
*
|
||||
* @goal test
|
||||
*/
|
||||
public class SomeMojo
|
||||
extends ClassB
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.java.version = 1.8+
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.basic-java-annotations:maven-it-basic-java-annotations:1.0-SNAPSHOT:it0014
|
||||
invoker.goals.3 = org.apache.maven.its.basic-java-annotations:maven-it-basic-java-annotations:1.0-SNAPSHOT:help
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.basic-java-annotations</groupId>
|
||||
<artifactId>maven-it-basic-java-annotations</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test :: basic-java-annotations-jdk8</name>
|
||||
<description>
|
||||
Test plugin-plugin, which tests maven-plugin-tools-api and
|
||||
maven-plugin-tools-java. This will generate a plugin descriptor from
|
||||
java-based mojo sources, install the plugin, and then use it.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<!-- pom properties values not taken into account since invoker defines properties -->
|
||||
<!-- that override what's defined in pom -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source><!-- avoid ${maven.compiler.source} since value is not as expected -->
|
||||
<target>1.8</target><!-- avoid ${maven.compiler.target} since value is not as expected -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "it0014" )
|
||||
public class CoreIt0014Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( property = "project.build.directory", required = true )
|
||||
private String outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "outputDirectory = " + outputDirectory );
|
||||
|
||||
File f = new File( outputDirectory );
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
try
|
||||
{
|
||||
touch.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error writing verification file.", e );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
import org.apache.maven.settings.Settings;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "first", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
@Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" )
|
||||
public class FirstMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* Project directory.
|
||||
*/
|
||||
@Parameter( defaultValue = "${basedir}", readonly = true )
|
||||
private File basedir;
|
||||
|
||||
@Parameter( property = "first.touchFile", defaultValue = "${project.build.directory}/touch.txt",
|
||||
required = true )
|
||||
private File touchFile;
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( name = "namedParam", alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class, hint = "test" )
|
||||
private Object projectHelper;
|
||||
|
||||
@Component
|
||||
private MavenSession session;
|
||||
|
||||
@Component
|
||||
private MavenProject project;
|
||||
|
||||
@Component
|
||||
private MojoExecution mojo;
|
||||
|
||||
@Component
|
||||
private PluginDescriptor plugin;
|
||||
|
||||
@Component
|
||||
private Settings settings;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.InstantiationStrategy;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
* Checks maximum annotations with non-default values.
|
||||
*
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
@Mojo( name = "maximal",
|
||||
aggregator = true,
|
||||
configurator = "configurator-hint",
|
||||
requiresDependencyResolution = ResolutionScope.COMPILE,
|
||||
requiresDependencyCollection = ResolutionScope.TEST,
|
||||
defaultPhase = LifecyclePhase.PACKAGE,
|
||||
executionStrategy = "always",
|
||||
instantiationStrategy = InstantiationStrategy.SINGLETON,
|
||||
inheritByDefault = false,
|
||||
requiresDirectInvocation = true,
|
||||
requiresOnline = true,
|
||||
requiresProject = false,
|
||||
requiresReports = true,
|
||||
threadSafe = true )
|
||||
@Execute( phase = LifecyclePhase.COMPILE )
|
||||
public class Maximal
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Parameter description.
|
||||
*
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
@Parameter( alias = "myAlias",
|
||||
property = "aProperty",
|
||||
defaultValue = "${anExpression}",
|
||||
readonly = true,
|
||||
required = true )
|
||||
private String param;
|
||||
|
||||
@Component( role = MavenProjectHelper.class, hint = "test" )
|
||||
private Object projectHelper;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
// minimum annotations => default values
|
||||
@Mojo( name = "minimal" )
|
||||
public class Minimal
|
||||
extends AbstractMojo
|
||||
{
|
||||
@Parameter
|
||||
private String param;
|
||||
|
||||
@Component
|
||||
private MavenProjectHelper projectHelper;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package fr.ca;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
public interface TestInterface {
|
||||
|
||||
/**
|
||||
* Java 8 required to support such default method implementation
|
||||
*/
|
||||
public default void foo(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "target/touch.txt" )
|
||||
assert touchFile.isFile()
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first" }[0]
|
||||
|
||||
assert mojo.goal.text() == 'first'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Touches a test file.'
|
||||
assert mojo.deprecated.text() == "Don't use!"
|
||||
assert mojo.requiresDependencyResolution.text() == 'test'
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == 'integration-test'
|
||||
assert mojo.executePhase.text() == 'generate-sources'
|
||||
assert mojo.executeLifecycle.text() == 'cobertura'
|
||||
|
||||
assert mojo.configuration.basedir[0].text() == ''
|
||||
assert mojo.configuration.basedir[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.basedir[0].'@default-value' == '${basedir}'
|
||||
|
||||
assert mojo.configuration.touchFile[0].text() == '${first.touchFile}'
|
||||
assert mojo.configuration.touchFile[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.touchFile[0].'@default-value' == '${project.build.directory}/touch.txt'
|
||||
|
||||
assert mojo.configuration.session[0].text() == ''
|
||||
assert mojo.configuration.session[0].'@implementation' == 'org.apache.maven.execution.MavenSession'
|
||||
assert mojo.configuration.session[0].'@default-value' == '${session}'
|
||||
|
||||
assert mojo.configuration.project[0].text() == ''
|
||||
assert mojo.configuration.project[0].'@implementation' == 'org.apache.maven.project.MavenProject'
|
||||
assert mojo.configuration.project[0].'@default-value' == '${project}'
|
||||
|
||||
assert mojo.configuration.mojo[0].text() == ''
|
||||
assert mojo.configuration.mojo[0].'@implementation' == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert mojo.configuration.mojo[0].'@default-value' == '${mojoExecution}'
|
||||
|
||||
assert mojo.configuration.plugin[0].text() == ''
|
||||
assert mojo.configuration.plugin[0].'@implementation' == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert mojo.configuration.plugin[0].'@default-value' == '${plugin}'
|
||||
|
||||
assert mojo.configuration.settings[0].text() == ''
|
||||
assert mojo.configuration.settings[0].'@implementation' == 'org.apache.maven.settings.Settings'
|
||||
assert mojo.configuration.settings[0].'@default-value' == '${settings}'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 1
|
||||
|
||||
assert mojo.requirements.requirement[0].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
assert mojo.requirements.requirement[0].'role-hint'.text() == 'test'
|
||||
assert mojo.requirements.requirement[0].'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 8
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "namedParam" }[0]
|
||||
assert parameter.name.text() == 'namedParam'
|
||||
assert parameter.alias.text() == 'alias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == 'As of 0.2'
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir" }[0]
|
||||
assert parameter.name.text() == 'basedir'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Project directory.'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "mojo" }[0]
|
||||
assert parameter.name.text() == 'mojo'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "plugin" }[0]
|
||||
assert parameter.name.text() == 'plugin'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "project" }[0]
|
||||
assert parameter.name.text() == 'project'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.project.MavenProject'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "session" }[0]
|
||||
assert parameter.name.text() == 'session'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.execution.MavenSession'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "settings" }[0]
|
||||
assert parameter.name.text() == 'settings'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.settings.Settings'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile" }[0]
|
||||
assert parameter.name.text() == 'touchFile'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
// check default values
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "minimal"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'minimal'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Minimal'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == ''
|
||||
assert mojo.deprecated.text() == ''
|
||||
assert mojo.requiresDependencyResolution.text() == ''
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.requiresReports.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == ''
|
||||
assert mojo.executePhase.text() == ''
|
||||
assert mojo.executeLifecycle.text() == ''
|
||||
assert mojo.executionStrategy.text() == 'once-per-session'
|
||||
assert mojo.inheritedByDefault.text() == 'true'
|
||||
assert mojo.instantiationStrategy.text() == 'per-lookup'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0]
|
||||
assert parameter.name.text() == 'param'
|
||||
assert parameter.alias.text() == ''
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == ''
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
def requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
|
||||
// check values set by every annotation
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "maximal"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'maximal'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Maximal'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Checks maximum annotations with non-default values.'
|
||||
assert mojo.deprecated.text() == 'deprecated-text'
|
||||
assert mojo.requiresDependencyResolution.text() == 'compile'
|
||||
assert mojo.requiresDependencyCollection.text() == 'test'
|
||||
assert mojo.requiresProject.text() == 'false'
|
||||
assert mojo.requiresOnline.text() == 'true'
|
||||
assert mojo.requiresDirectInvocation.text() == 'true'
|
||||
assert mojo.requiresReports.text() == 'true'
|
||||
assert mojo.aggregator.text() == 'true'
|
||||
assert mojo.configurator.text() == 'configurator-hint'
|
||||
assert mojo.threadSafe.text() == 'true'
|
||||
assert mojo.phase.text() == 'package'
|
||||
assert mojo.executePhase.text() == 'compile'
|
||||
assert mojo.executeLifecycle.text() == ''
|
||||
assert mojo.executionStrategy.text() == 'always'
|
||||
assert mojo.inheritedByDefault.text() == 'false'
|
||||
assert mojo.instantiationStrategy.text() == 'singleton'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0]
|
||||
assert parameter.name.text() == 'param'
|
||||
assert parameter.alias.text() == 'myAlias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.since.text() == 'since-text'
|
||||
assert parameter.deprecated.text() == 'deprecated-text'
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Parameter description.'
|
||||
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
|
||||
// check help mojo source and class
|
||||
assert new File( basedir, "target/classes/org/apache/maven/plugin/coreit/HelpMojo.class" ).isFile()
|
||||
assert new File( basedir, "target/generated-sources/plugin/org/apache/maven/plugin/coreit/HelpMojo.java" ).isFile()
|
||||
assert !new File( basedir, "target/generated-sources/plugin/HelpMojo.java" ).isFile()
|
||||
|
||||
return true;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.basic-java-annotations:maven-it-basic-java-annotations:1.0-SNAPSHOT:it0014
|
||||
invoker.goals.3 = org.apache.maven.its.basic-java-annotations:maven-it-basic-java-annotations:1.0-SNAPSHOT:help
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.basic-java-annotations</groupId>
|
||||
<artifactId>maven-it-basic-java-annotations</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test :: basic-java-annotations</name>
|
||||
<description>
|
||||
Test plugin-plugin, which tests maven-plugin-tools-api and
|
||||
maven-plugin-tools-java. This will generate a plugin descriptor from
|
||||
java-based mojo sources, install the plugin, and then use it.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
*/
|
||||
@Mojo( name = "it0014" )
|
||||
public class CoreIt0014Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( property = "project.build.directory", required = true )
|
||||
private String outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "outputDirectory = " + outputDirectory );
|
||||
|
||||
File f = new File( outputDirectory );
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
try
|
||||
{
|
||||
touch.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error writing verification file.", e );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
import org.apache.maven.settings.Settings;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated Don't use!
|
||||
*/
|
||||
@Mojo( name = "first", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST )
|
||||
@Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" )
|
||||
public class FirstMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* Project directory.
|
||||
*/
|
||||
@Parameter( defaultValue = "${basedir}", readonly = true )
|
||||
private File basedir;
|
||||
|
||||
@Parameter( property = "first.touchFile", defaultValue = "${project.build.directory}/touch.txt",
|
||||
required = true )
|
||||
private File touchFile;
|
||||
|
||||
/**
|
||||
* @since 0.1
|
||||
* @deprecated As of 0.2
|
||||
*/
|
||||
@Parameter( name = "namedParam", alias = "alias" )
|
||||
private String aliasedParam;
|
||||
|
||||
@Component( role = MavenProjectHelper.class, hint = "test" )
|
||||
private Object projectHelper;
|
||||
|
||||
@Component
|
||||
private MavenSession session;
|
||||
|
||||
@Component
|
||||
private MavenProject project;
|
||||
|
||||
@Component
|
||||
private MojoExecution mojo;
|
||||
|
||||
@Component
|
||||
private PluginDescriptor plugin;
|
||||
|
||||
@Component
|
||||
private Settings settings;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.InstantiationStrategy;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
* Checks maximum annotations with non-default values.
|
||||
*
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
@Mojo( name = "maximal",
|
||||
aggregator = true,
|
||||
configurator = "configurator-hint",
|
||||
requiresDependencyResolution = ResolutionScope.COMPILE,
|
||||
requiresDependencyCollection = ResolutionScope.TEST,
|
||||
defaultPhase = LifecyclePhase.PACKAGE,
|
||||
executionStrategy = "always",
|
||||
instantiationStrategy = InstantiationStrategy.SINGLETON,
|
||||
inheritByDefault = false,
|
||||
requiresDirectInvocation = true,
|
||||
requiresOnline = true,
|
||||
requiresProject = false,
|
||||
requiresReports = true,
|
||||
threadSafe = true )
|
||||
@Execute( phase = LifecyclePhase.COMPILE )
|
||||
public class Maximal
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Parameter description.
|
||||
*
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
@Parameter( alias = "myAlias",
|
||||
property = "aProperty",
|
||||
defaultValue = "${anExpression}",
|
||||
readonly = true,
|
||||
required = true )
|
||||
private String param;
|
||||
|
||||
@Component( role = MavenProjectHelper.class, hint = "test" )
|
||||
private Object projectHelper;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
// minimum annotations => default values
|
||||
@Mojo( name = "minimal" )
|
||||
public class Minimal
|
||||
extends AbstractMojo
|
||||
{
|
||||
@Parameter
|
||||
private String param;
|
||||
|
||||
@Component
|
||||
private MavenProjectHelper projectHelper;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File touchFile = new File( basedir, "target/touch.txt" )
|
||||
assert touchFile.isFile()
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first" }[0]
|
||||
|
||||
assert mojo.goal.text() == 'first'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Touches a test file.'
|
||||
assert mojo.deprecated.text() == "Don't use!"
|
||||
assert mojo.requiresDependencyResolution.text() == 'test'
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == 'integration-test'
|
||||
assert mojo.executePhase.text() == 'generate-sources'
|
||||
assert mojo.executeLifecycle.text() == 'cobertura'
|
||||
|
||||
assert mojo.configuration.basedir[0].text() == ''
|
||||
assert mojo.configuration.basedir[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.basedir[0].'@default-value' == '${basedir}'
|
||||
|
||||
assert mojo.configuration.touchFile[0].text() == '${first.touchFile}'
|
||||
assert mojo.configuration.touchFile[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.touchFile[0].'@default-value' == '${project.build.directory}/touch.txt'
|
||||
|
||||
assert mojo.configuration.session[0].text() == ''
|
||||
assert mojo.configuration.session[0].'@implementation' == 'org.apache.maven.execution.MavenSession'
|
||||
assert mojo.configuration.session[0].'@default-value' == '${session}'
|
||||
|
||||
assert mojo.configuration.project[0].text() == ''
|
||||
assert mojo.configuration.project[0].'@implementation' == 'org.apache.maven.project.MavenProject'
|
||||
assert mojo.configuration.project[0].'@default-value' == '${project}'
|
||||
|
||||
assert mojo.configuration.mojo[0].text() == ''
|
||||
assert mojo.configuration.mojo[0].'@implementation' == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert mojo.configuration.mojo[0].'@default-value' == '${mojoExecution}'
|
||||
|
||||
assert mojo.configuration.plugin[0].text() == ''
|
||||
assert mojo.configuration.plugin[0].'@implementation' == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert mojo.configuration.plugin[0].'@default-value' == '${plugin}'
|
||||
|
||||
assert mojo.configuration.settings[0].text() == ''
|
||||
assert mojo.configuration.settings[0].'@implementation' == 'org.apache.maven.settings.Settings'
|
||||
assert mojo.configuration.settings[0].'@default-value' == '${settings}'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 1
|
||||
|
||||
assert mojo.requirements.requirement[0].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
assert mojo.requirements.requirement[0].'role-hint'.text() == 'test'
|
||||
assert mojo.requirements.requirement[0].'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 8
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "namedParam" }[0]
|
||||
assert parameter.name.text() == 'namedParam'
|
||||
assert parameter.alias.text() == 'alias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == 'As of 0.2'
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir" }[0]
|
||||
assert parameter.name.text() == 'basedir'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Project directory.'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "mojo" }[0]
|
||||
assert parameter.name.text() == 'mojo'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "plugin" }[0]
|
||||
assert parameter.name.text() == 'plugin'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "project" }[0]
|
||||
assert parameter.name.text() == 'project'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.project.MavenProject'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "session" }[0]
|
||||
assert parameter.name.text() == 'session'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.execution.MavenSession'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "settings" }[0]
|
||||
assert parameter.name.text() == 'settings'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.settings.Settings'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile" }[0]
|
||||
assert parameter.name.text() == 'touchFile'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'java.io.File'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
// check default values
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "minimal"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'minimal'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Minimal'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == ''
|
||||
assert mojo.deprecated.text() == ''
|
||||
assert mojo.requiresDependencyResolution.text() == ''
|
||||
assert mojo.requiresDependencyCollection.text() == ''
|
||||
assert mojo.requiresProject.text() == 'true'
|
||||
assert mojo.requiresOnline.text() == 'false'
|
||||
assert mojo.requiresDirectInvocation.text() == 'false'
|
||||
assert mojo.requiresReports.text() == 'false'
|
||||
assert mojo.aggregator.text() == 'false'
|
||||
assert mojo.threadSafe.text() == 'false'
|
||||
assert mojo.phase.text() == ''
|
||||
assert mojo.executePhase.text() == ''
|
||||
assert mojo.executeLifecycle.text() == ''
|
||||
assert mojo.executionStrategy.text() == 'once-per-session'
|
||||
assert mojo.inheritedByDefault.text() == 'true'
|
||||
assert mojo.instantiationStrategy.text() == 'per-lookup'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0]
|
||||
assert parameter.name.text() == 'param'
|
||||
assert parameter.alias.text() == ''
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.deprecated.text() == ''
|
||||
assert parameter.required.text() == 'false'
|
||||
assert parameter.editable.text() == 'true'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
def requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
|
||||
// check values set by every annotation
|
||||
mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "maximal"}[0]
|
||||
|
||||
assert mojo.goal.text() == 'maximal'
|
||||
assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Maximal'
|
||||
assert mojo.language.text() == 'java'
|
||||
assert mojo.description.text() == 'Checks maximum annotations with non-default values.'
|
||||
assert mojo.deprecated.text() == 'deprecated-text'
|
||||
assert mojo.requiresDependencyResolution.text() == 'compile'
|
||||
assert mojo.requiresDependencyCollection.text() == 'test'
|
||||
assert mojo.requiresProject.text() == 'false'
|
||||
assert mojo.requiresOnline.text() == 'true'
|
||||
assert mojo.requiresDirectInvocation.text() == 'true'
|
||||
assert mojo.requiresReports.text() == 'true'
|
||||
assert mojo.aggregator.text() == 'true'
|
||||
assert mojo.configurator.text() == 'configurator-hint'
|
||||
assert mojo.threadSafe.text() == 'true'
|
||||
assert mojo.phase.text() == 'package'
|
||||
assert mojo.executePhase.text() == 'compile'
|
||||
assert mojo.executeLifecycle.text() == ''
|
||||
assert mojo.executionStrategy.text() == 'always'
|
||||
assert mojo.inheritedByDefault.text() == 'false'
|
||||
assert mojo.instantiationStrategy.text() == 'singleton'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0]
|
||||
assert parameter.name.text() == 'param'
|
||||
assert parameter.alias.text() == 'myAlias'
|
||||
assert parameter.type.text() == 'java.lang.String'
|
||||
assert parameter.since.text() == 'since-text'
|
||||
assert parameter.deprecated.text() == 'deprecated-text'
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Parameter description.'
|
||||
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
|
||||
// check help mojo source and class
|
||||
assert new File( basedir, "target/classes/org/apache/maven/plugin/coreit/HelpMojo.class" ).isFile()
|
||||
assert new File( basedir, "target/generated-sources/plugin/org/apache/maven/plugin/coreit/HelpMojo.java" ).isFile()
|
||||
assert !new File( basedir, "target/generated-sources/plugin/HelpMojo.java" ).isFile()
|
||||
|
||||
return true;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.it0013:maven-it-it0013:1.0-SNAPSHOT:it0013
|
||||
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.maven.its.it0013</groupId>
|
||||
<artifactId>maven-it-it0013</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<name>Maven Integration Test :: it0013</name>
|
||||
<description>
|
||||
Test plugin-plugin, which tests maven-plugin-tools-api and
|
||||
maven-plugin-tools-java. This will generate a plugin descriptor from
|
||||
java-based mojo sources, install the plugin, and then use it.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @goal it0013
|
||||
*/
|
||||
public class CoreIt0013Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* @parameter property="project.build.directory"
|
||||
* @required
|
||||
*/
|
||||
private String outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "outputDirectory = " + outputDirectory );
|
||||
|
||||
File f = new File( outputDirectory );
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
try
|
||||
{
|
||||
touch.createNewFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error writing verification file.", e );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.settings.Settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Touches a test file.
|
||||
*
|
||||
* @goal first
|
||||
* @requiresDependencyResolution test
|
||||
* @phase integration-test
|
||||
* @execute phase="generate-sources" lifecycle="cobertura"
|
||||
* @deprecated Don't use!
|
||||
* @since 1.2
|
||||
*/
|
||||
public class FirstMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* Project directory.
|
||||
* @parameter default-value="${basedir}"
|
||||
* @readonly
|
||||
*/
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* @parameter expression="first.touchFile" default-value="${project.build.directory}/touch.txt"
|
||||
* @required
|
||||
*/
|
||||
private File touchFile;
|
||||
|
||||
/**
|
||||
* @parameter name="namedParam" alias="alias"
|
||||
* @deprecated As of 0.2
|
||||
* @since 0.1
|
||||
*/
|
||||
private String aliasedParam;
|
||||
|
||||
/**
|
||||
* @component role="org.apache.maven.project.MavenProjectHelper" roleHint="test"
|
||||
*/
|
||||
private Object projectHelper;
|
||||
|
||||
/**
|
||||
* @component
|
||||
*/
|
||||
private MavenSession session;
|
||||
|
||||
/**
|
||||
* @component
|
||||
*/
|
||||
private MavenProject project;
|
||||
|
||||
/**
|
||||
* @component
|
||||
*/
|
||||
private MojoExecution mojo;
|
||||
|
||||
/**
|
||||
* @component
|
||||
*/
|
||||
private PluginDescriptor plugin;
|
||||
|
||||
/**
|
||||
* @component
|
||||
*/
|
||||
private Settings settings;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
* Checks maximum annotations with non-default values.
|
||||
*
|
||||
* @goal maximal
|
||||
* @aggregator
|
||||
* @configurator configurator-hint
|
||||
* @execute phase="compile"
|
||||
* @executionStrategy always
|
||||
* @inheritByDefault false
|
||||
* @instantiationStrategy singleton
|
||||
* @phase package
|
||||
* @requiresDependencyResolution compile
|
||||
* @requiresDependencyCollection test
|
||||
* @requiresDirectInvocation true
|
||||
* @requiresOnline true
|
||||
* @requiresProject false
|
||||
* @requiresReports true
|
||||
* @threadSafe
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
public class Maximal
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Parameter description.
|
||||
*
|
||||
* @parameter alias="myAlias" implementation="my.implementation" property="aProperty" default-value="${anExpression}"
|
||||
* @readonly
|
||||
* @required
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
private String param;
|
||||
|
||||
/**
|
||||
* @component role="org.apache.maven.project.MavenProjectHelper" roleHint="test"
|
||||
* @since since-text
|
||||
* @deprecated deprecated-text
|
||||
*/
|
||||
private Object projectHelper;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue