@@ -48,18 +48,42 @@ jobs:
4848
4949 cd velocity-test
5050
51- # Add Velocity dependency
52- sed -i '/<dependencies>/a \
53- <dependency>\
54- <groupId>org.apache.velocity</groupId>\
55- <artifactId>velocity-engine-core</artifactId>\
56- <version>2.3</version>\
57- </dependency>' pom.xml
58-
59- # Set compiler version to 1.8
60- sed -i '/<properties>/a \
61- <maven.compiler.source>1.8</maven.compiler.source>\
62- <maven.compiler.target>1.8</maven.compiler.target>' pom.xml
51+ # Overwrite pom.xml to ensure correct compiler version and dependencies
52+ cat > pom.xml << EOF
53+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
54+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
55+ <modelVersion>4.0.0</modelVersion>
56+ <groupId>com.example.velocity</groupId>
57+ <artifactId>velocity-test</artifactId>
58+ <packaging>jar</packaging>
59+ <version>1.0-SNAPSHOT</version>
60+ <name>velocity-test</name>
61+ <url>http://maven.apache.org</url>
62+ <properties>
63+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
64+ <maven.compiler.source>1.8</maven.compiler.source>
65+ <maven.compiler.target>1.8</maven.compiler.target>
66+ </properties>
67+ <dependencies>
68+ <dependency>
69+ <groupId>junit</groupId>
70+ <artifactId>junit</artifactId>
71+ <version>3.8.1</version>
72+ <scope>test</scope>
73+ </dependency>
74+ <dependency>
75+ <groupId>org.apache.velocity</groupId>
76+ <artifactId>velocity-engine-core</artifactId>
77+ <version>2.3</version>
78+ </dependency>
79+ <dependency>
80+ <groupId>org.slf4j</groupId>
81+ <artifactId>slf4j-simple</artifactId>
82+ <version>1.7.36</version>
83+ </dependency>
84+ </dependencies>
85+ </project>
86+ EOF
6387
6488 echo "install_status=success" >> $GITHUB_OUTPUT
6589
0 commit comments