Author: rec Date: Fri May 31 11:00:07 2013 New Revision: 1488148 URL: http://svn.apache.org/r1488148 Log: [UIMA-2471] add a jcasgen-maven-plugin (and m2e connector) - Make sure that the embeddded m2e integration tests use the artifacts from the current maven build
Added: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml (with props) Modified: uima/uimaj/trunk/jcasgen-maven-plugin/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/classpath/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref1/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref2/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/simple/pom.xml uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/src/org/apache/uima/tools/jcasgen/maven/JCasGenM2ETest.java Modified: uima/uimaj/trunk/jcasgen-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/pom.xml Fri May 31 11:00:07 2013 @@ -87,6 +87,11 @@ <settingsFile>src/it/settings.xml</settingsFile> <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> <postBuildHookScript>verify.bsh</postBuildHookScript> + <goals> + <goal>clean</goal> + <goal>package</goal> + <goal>integration-test</goal> + </goals> </configuration> <executions> <execution> Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/pom.xml Fri May 31 11:00:07 2013 @@ -1,25 +1,27 @@ <?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 + 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 + 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. + 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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<project + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.uima</groupId> + <groupId>org.apache.uima</groupId> <artifactId>org.apache.uima.tools.jcasgen.maven.tests.m2e</artifactId> <version>0.9.2-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> @@ -46,6 +48,8 @@ </repositories> <properties> <tycho-version>0.15.0</tycho-version> + <main.project.version>@project.version@</main.project.version> + <main.localRepositoryUrl>@localRepositoryUrl@</main.localRepositoryUrl> </properties> <build> <plugins> @@ -64,6 +68,38 @@ <ignoreTychoRepositories>true</ignoreTychoRepositories> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <execution> + <id>copy-projects</id> + <phase>generate-test-resources</phase> + <goals> + <goal>run</goal> + </goals> + <inherited>false</inherited> + <configuration> + <target> + <!-- Propagate the versions of the UIMA framework into the m2e tests --> + <copy todir="${project.build.directory}/projects" verbose="yes" overwrite="yes"> + <fileset dir="projects" /> + <filterset> + <filter token="project.version" value="${main.project.version}" /> + </filterset> + </copy> + <!-- Propagate the jcasgen-maven-plugin artifact being built into the m2e tests --> + <copy file="settings-template.xml" tofile="${project.build.directory}/../settings.xml" verbose="yes" overwrite="yes"> + <filterset> + <filter token="localRepositoryUrl" value="${main.localRepositoryUrl}" /> + </filterset> + </copy> + </target> + </configuration> + </execution> + </executions> + </plugin> </plugins> <pluginManagement> <plugins> @@ -84,7 +120,7 @@ </plugin> </plugins> </pluginManagement> - + </build> <profiles> <profile> Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/classpath/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/classpath/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/classpath/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/classpath/pom.xml Fri May 31 11:00:07 2013 @@ -27,7 +27,7 @@ <plugin> <groupId>org.apache.uima</groupId> <artifactId>jcasgen-maven-plugin</artifactId> - <version>0.9.3-SNAPSHOT</version> + <version>@project.version@</version> <configuration> <typeSystem>src/main/resources/TypeSystem.xml</typeSystem> </configuration> @@ -45,7 +45,7 @@ <dependency> <groupId>org.apache.uima</groupId> <artifactId>uimaj-core</artifactId> - <version>2.4.0</version> + <version>@project.version@</version> </dependency> </dependencies> </project> \ No newline at end of file Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref1/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref1/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref1/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref1/pom.xml Fri May 31 11:00:07 2013 @@ -27,7 +27,7 @@ <plugin> <groupId>org.apache.uima</groupId> <artifactId>jcasgen-maven-plugin</artifactId> - <version>0.9.3-SNAPSHOT</version> + <version>@project.version@</version> <configuration> <typeSystem>src/main/resources/type/Token.xml</typeSystem> </configuration> @@ -45,7 +45,7 @@ <dependency> <groupId>org.apache.uima</groupId> <artifactId>uimaj-core</artifactId> - <version>2.4.0</version> + <version>@project.version@</version> </dependency> </dependencies> </project> \ No newline at end of file Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref2/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref2/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref2/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/crossref2/pom.xml Fri May 31 11:00:07 2013 @@ -27,7 +27,7 @@ <plugin> <groupId>org.apache.uima</groupId> <artifactId>jcasgen-maven-plugin</artifactId> - <version>0.9.3-SNAPSHOT</version> + <version>@project.version@</version> <configuration> <typeSystem>src/main/resources/TypeSystem.xml</typeSystem> </configuration> @@ -50,7 +50,7 @@ <dependency> <groupId>org.apache.uima</groupId> <artifactId>uimaj-core</artifactId> - <version>2.4.0</version> + <version>@project.version@</version> </dependency> </dependencies> </project> \ No newline at end of file Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/simple/pom.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/simple/pom.xml?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/simple/pom.xml (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/projects/jcasgen/simple/pom.xml Fri May 31 11:00:07 2013 @@ -27,7 +27,7 @@ <plugin> <groupId>org.apache.uima</groupId> <artifactId>jcasgen-maven-plugin</artifactId> - <version>0.9.3-SNAPSHOT</version> + <version>@project.version@</version> <configuration> <typeSystem>src/main/resources/TypeSystem.xml</typeSystem> </configuration> @@ -45,7 +45,7 @@ <dependency> <groupId>org.apache.uima</groupId> <artifactId>uimaj-core</artifactId> - <version>2.4.0</version> + <version>@project.version@</version> </dependency> </dependencies> </project> \ No newline at end of file Added: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml?rev=1488148&view=auto ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml (added) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml Fri May 31 11:00:07 2013 @@ -0,0 +1,56 @@ +<?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. +--> +<settings> + <!-- Get the jcasgen-maven-plugin artifacts from here --> + <localRepository>../../local-repo</localRepository> + <!-- Get the rest from here --> + <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> \ No newline at end of file Propchange: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/settings-template.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/src/org/apache/uima/tools/jcasgen/maven/JCasGenM2ETest.java URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/src/org/apache/uima/tools/jcasgen/maven/JCasGenM2ETest.java?rev=1488148&r1=1488147&r2=1488148&view=diff ============================================================================== --- uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/src/org/apache/uima/tools/jcasgen/maven/JCasGenM2ETest.java (original) +++ uima/uimaj/trunk/jcasgen-maven-plugin/src/it/m2e/src/org/apache/uima/tools/jcasgen/maven/JCasGenM2ETest.java Fri May 31 11:00:07 2013 @@ -29,12 +29,15 @@ import org.eclipse.jdt.core.IClasspathEn import org.eclipse.jdt.core.JavaCore; import org.eclipse.m2e.core.project.ResolverConfiguration; import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase; +import org.eclipse.m2e.core.MavenPlugin; @SuppressWarnings("restriction") public class JCasGenM2ETest extends AbstractMavenProjectTestCase { public void testSimple() throws Exception { + System.out.println("Using this repository: " + MavenPlugin.getMaven().getLocalRepository()); + ResolverConfiguration configuration = new ResolverConfiguration(); - IProject project = importProject("projects/jcasgen/simple/pom.xml", configuration); + IProject project = importProject("target/projects/jcasgen/simple/pom.xml", configuration); waitForJobsToComplete(); assertNoErrors(project); @@ -72,7 +75,7 @@ public class JCasGenM2ETest extends Abst public void testEmptyOutputDirectory() throws Exception { ResolverConfiguration configuration = new ResolverConfiguration(); - IProject project = importProject("projects/jcasgen/simple/pom.xml", configuration); + IProject project = importProject("target/projects/jcasgen/simple/pom.xml", configuration); waitForJobsToComplete(); assertNoErrors(project); @@ -98,7 +101,7 @@ public class JCasGenM2ETest extends Abst public void testTypeSystemReferences() throws Exception { ResolverConfiguration configuration = new ResolverConfiguration(); - IProject project = importProject("projects/jcasgen/classpath/pom.xml", configuration); + IProject project = importProject("target/projects/jcasgen/classpath/pom.xml", configuration); waitForJobsToComplete(); assertNoErrors(project); @@ -178,7 +181,7 @@ public class JCasGenM2ETest extends Abst public void testCrossProjectReferences() throws Exception { ResolverConfiguration configuration = new ResolverConfiguration(); String[] projectPoms = new String[] { "crossref1/pom.xml", "crossref2/pom.xml" }; - IProject[] projects = importProjects("projects/jcasgen", projectPoms, configuration); + IProject[] projects = importProjects("target/projects/jcasgen", projectPoms, configuration); waitForJobsToComplete(); for (IProject project : projects) { assertNoErrors(project);