Author: hboutemy Date: Fri Oct 31 21:49:11 2014 New Revision: 1635869 URL: http://svn.apache.org/r1635869 Log: [MTOOLCHAINS-7] added an IT that check expected failure, and fixed the java annotations migration (yes, the IT was immediately useful)
Added: maven/plugins/trunk/maven-toolchains-plugin/src/it/ maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/ maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties (with props) maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml (with props) maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy (with props) maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml (with props) Modified: maven/plugins/trunk/maven-toolchains-plugin/pom.xml maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java Modified: maven/plugins/trunk/maven-toolchains-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/pom.xml?rev=1635869&r1=1635868&r2=1635869&view=diff ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-toolchains-plugin/pom.xml Fri Oct 31 21:49:11 2014 @@ -75,40 +75,25 @@ under the License. <artifactId>maven-plugin-annotations</artifactId> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> </dependencies> <profiles> <profile> <id>run-its</id> <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>integration-test</id> - <phase>integration-test</phase> - <configuration> - <tasks> - <echo /><echo /><echo /><echo /><echo /> - <echo level="warning">NO INTEGRATION TESTS DEFINED</echo> - <echo /><echo /><echo /><echo /><echo /> - </tasks> - </configuration> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> <goals> - <goal>run</goal> + <goal>validate</goal> </goals> - </execution> - </executions> - </plugin> - </plugins> + </configuration> + </plugin> + </plugins> + </pluginManagement> </build> </profile> </profiles> Added: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties?rev=1635869&view=auto ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties (added) +++ maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties Fri Oct 31 21:49:11 2014 @@ -0,0 +1,18 @@ +# 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.buildResult = failure Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml?rev=1635869&view=auto ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml (added) +++ maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml Fri Oct 31 21:49:11 2014 @@ -0,0 +1,63 @@ +<?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.plugins.toolchains.its</groupId> + <artifactId>missing-toolchain</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>maven-toolchains-plugin IT: missing toolchain test</name> + <description> + Check that toolchain requirements are checked and not covered as expected + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-toolchains-plugin</artifactId> + <version>@project.version@</version> + <executions> + <execution> + <goals> + <goal>toolchain</goal> + </goals> + </execution> + </executions> + <configuration> + <toolchains> + <jdk> + <version>12</version> + </jdk> + <fake-type> + <attribute>value</attribute> + <other-attribute>other-value</other-attribute> + </fake-type> + </toolchains> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy?rev=1635869&view=auto ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy (added) +++ maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy Fri Oct 31 21:49:11 2014 @@ -0,0 +1,22 @@ +/* + * 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. + */ + +content = new File( basedir, 'build.log' ).text + +assert content.indexOf( "MojoFailureException: Cannot find matching toolchain definitions for the following toolchain types:" ) > 0 Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/missing-toolchain/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml?rev=1635869&view=auto ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml (added) +++ maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml Fri Oct 31 21:49:11 2014 @@ -0,0 +1,55 @@ +<?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. +--> + +<settings> + <profiles> + <profile> + <id>it-repo</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local.central</id> + <url>@localRepositoryUrl@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> +</settings> Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-toolchains-plugin/src/it/settings.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java?rev=1635869&r1=1635868&r2=1635869&view=diff ============================================================================== --- maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java (original) +++ maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java Fri Oct 31 21:49:11 2014 @@ -41,7 +41,7 @@ import java.util.Map; /** * @author mkleint */ -@Mojo( name = "toolchain", defaultPhase = LifecyclePhase.VALIDATE ) +@Mojo( name = "toolchain", defaultPhase = LifecyclePhase.VALIDATE, configurator = "override" ) public class ToolchainMojo extends AbstractMojo {