Skip to content

Commit 090c3c6

Browse files
committed
feat(pom): add codeforces problem property and refactor exec plugin
1 parent ceeab4c commit 090c3c6

File tree

1 file changed

+38
-13
lines changed

1 file changed

+38
-13
lines changed

pom.xml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<maven.compiler.target>24</maven.compiler.target>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<problem>p140</problem>
19+
<codeforcesProblem>p71A</codeforcesProblem>
1920
</properties>
2021

2122
<dependencies>
@@ -31,7 +32,6 @@
3132
<version>6.0.0-M1</version>
3233
<scope>test</scope>
3334
</dependency>
34-
3535
</dependencies>
3636

3737
<build>
@@ -108,7 +108,6 @@
108108
</execution>
109109
</executions>
110110
</plugin>
111-
112111
<plugin>
113112
<groupId>org.apache.maven.plugins</groupId>
114113
<artifactId>maven-surefire-plugin</artifactId>
@@ -117,21 +116,47 @@
117116
<testFailureIgnore>true</testFailureIgnore>
118117
</configuration>
119118
</plugin>
120-
121119
<plugin>
122120
<groupId>org.codehaus.mojo</groupId>
123121
<artifactId>exec-maven-plugin</artifactId>
124122
<version>3.5.1</version>
125-
<configuration>
126-
<executable>bash</executable>
127-
<arguments>
128-
<argument>-c</argument>
129-
<!-- Updated to use $JAVA_HOME/bin/java -->
130-
<argument>"$JAVA_HOME/bin/java" -cp ${project.build.directory}/classes com.lzw.solutions.uva.${problem}.Main &lt;src/main/resources/uva/${problem}/1.in</argument>
131-
</arguments>
132-
</configuration>
123+
<executions>
124+
<!-- UVA Execution -->
125+
<execution>
126+
<id>run-uva</id>
127+
<phase>verify</phase>
128+
<goals>
129+
<goal>exec</goal>
130+
</goals>
131+
<configuration>
132+
<executable>${java.home}/bin/java</executable>
133+
<arguments>
134+
<argument>-cp</argument>
135+
<argument>${project.build.directory}/classes</argument>
136+
<argument>com.lzw.solutions.uva.${problem}.Main</argument>
137+
<argument>&lt; src/main/resources/uva/${problem}/1.in</argument>
138+
</arguments>
139+
</configuration>
140+
</execution>
141+
<!-- Codeforces Execution -->
142+
<execution>
143+
<id>run-codeforces</id>
144+
<phase>verify</phase>
145+
<goals>
146+
<goal>exec</goal>
147+
</goals>
148+
<configuration>
149+
<executable>${java.home}/bin/java</executable>
150+
<arguments>
151+
<argument>-cp</argument>
152+
<argument>${project.build.directory}/classes</argument>
153+
<argument>com.lzw.solutions.codeforces.${codeforcesProblem}.Main</argument>
154+
<argument>&lt; src/main/resources/codeforces/${codeforcesProblem}/1.in</argument>
155+
</arguments>
156+
</configuration>
157+
</execution>
158+
</executions>
133159
</plugin>
134-
135160
</plugins>
136161
</build>
137-
</project>
162+
</project>

0 commit comments

Comments
 (0)