This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch feat/WW-5864-struts-maven-plugin-watch in repository https://gitbox.apache.org/repos/asf/struts.git
commit 0fb7e3943f4f2f4fa4b082c92a46783a9ca58ce5 Author: Lukasz Lenart <[email protected]> AuthorDate: Sat Nov 14 08:55:42 2026 +0100 WW-5864 test(tools): invoker IT for struts:watch Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --- tools/struts-maven-plugin/pom.xml | 22 +++++++++ .../src/it/watch-pushes-change/invoker.properties | 19 ++++++++ .../src/it/watch-pushes-change/pom.xml | 54 ++++++++++++++++++++++ .../src/it/watch-pushes-change/prebuild.groovy | 26 +++++++++++ .../src/main/resources/messages.properties | 19 ++++++++ .../src/main/resources/struts.xml | 25 ++++++++++ .../src/it/watch-pushes-change/verify.groovy | 22 +++++++++ 7 files changed, 187 insertions(+) diff --git a/tools/struts-maven-plugin/pom.xml b/tools/struts-maven-plugin/pom.xml index a685b2816..266c4d9d4 100644 --- a/tools/struts-maven-plugin/pom.xml +++ b/tools/struts-maven-plugin/pom.xml @@ -64,6 +64,28 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <version>3.10.1</version> + <configuration> + <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> + <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> + <projectsDirectory>src/it</projectsDirectory> + <preBuildHookScript>prebuild</preBuildHookScript> + <postBuildHookScript>verify</postBuildHookScript> + <streamLogsOnFailures>true</streamLogsOnFailures> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/invoker.properties b/tools/struts-maven-plugin/src/it/watch-pushes-change/invoker.properties new file mode 100644 index 000000000..0c21882c7 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/invoker.properties @@ -0,0 +1,19 @@ +# +# 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 = process-resources ${project.groupId}:${project.artifactId}:${project.version}:watch diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/pom.xml b/tools/struts-maven-plugin/src/it/watch-pushes-change/pom.xml new file mode 100644 index 000000000..e84e8d441 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/pom.xml @@ -0,0 +1,54 @@ +<?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>org.apache.struts.it</groupId> + <artifactId>watch-pushes-change</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <greeting>hi</greeting> + </properties> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>@project.groupId@</groupId> + <artifactId>@project.artifactId@</artifactId> + <version>@project.version@</version> + <configuration> + <timeout>20</timeout> + <pollInterval>200</pollInterval> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/prebuild.groovy b/tools/struts-maven-plugin/src/it/watch-pushes-change/prebuild.groovy new file mode 100644 index 000000000..6c10bb2e1 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/prebuild.groovy @@ -0,0 +1,26 @@ +/* + * 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. + */ + +def messages = new File(basedir, 'src/main/resources/messages.properties') +def editor = new Thread({ + Thread.sleep(8000) + messages.text = messages.text.replace('-v1', '-v2\n') +}) +editor.setDaemon(true) +editor.start() diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/messages.properties b/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/messages.properties new file mode 100644 index 000000000..b4e502fe8 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/messages.properties @@ -0,0 +1,19 @@ +# +# 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. +# +msg=${greeting}-v1 diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/struts.xml b/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/struts.xml new file mode 100644 index 000000000..778333325 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/src/main/resources/struts.xml @@ -0,0 +1,25 @@ +<?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. + */ +--> +<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 6.0//EN" "https://struts.apache.org/dtds/struts-6.0.dtd"> +<struts> + <constant name="struts.devMode" value="true"/> +</struts> diff --git a/tools/struts-maven-plugin/src/it/watch-pushes-change/verify.groovy b/tools/struts-maven-plugin/src/it/watch-pushes-change/verify.groovy new file mode 100644 index 000000000..ce2aba6c3 --- /dev/null +++ b/tools/struts-maven-plugin/src/it/watch-pushes-change/verify.groovy @@ -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. + */ + +def classes = new File(basedir, 'target/classes/messages.properties') +assert classes.text.contains('msg=hi-v2') : "filtered v2 missing: ${classes.text}" +assert new File(basedir, 'build.log').text.contains('pushed messages.properties')
