Skip to content

Commit c5839de

Browse files
committed
fix(pom): simplify exec-maven-plugin configuration and remove local file handling
1 parent f9457be commit c5839de

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

pom.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,10 @@
119119
<artifactId>exec-maven-plugin</artifactId>
120120
<version>3.5.0</version>
121121
<configuration>
122-
<executable>java</executable>
122+
<executable>bash</executable>
123123
<arguments>
124-
<argument>-cp</argument>
125-
<argument>${project.build.directory}/classes</argument>
126-
<argument>com.lzw.solutions.uva.${problem}.Main</argument>
127-
<argument>&lt;</argument>
128-
<argument>src/main/resources/uva/${problem}/1.in</argument>
124+
<argument>-c</argument>
125+
<argument>java -cp ${project.build.directory}/classes com.lzw.solutions.uva.${problem}.Main &lt; src/main/resources/uva/${problem}/1.in</argument>
129126
</arguments>
130127
</configuration>
131128
</plugin>

src/main/java/com/lzw/solutions/uva/p138/Main.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,8 @@ void close() throws IOException {
5151
}
5252

5353
public static void main(String[] args) throws Exception {
54-
FileInputStream inStream = null;
55-
PrintStream outStream = null;
56-
boolean isLocal = System.getProperty("os.name").equals("Mac OS X");
57-
if (isLocal) {
58-
inStream = new FileInputStream("1.in");
59-
// outStream = new PrintStream("1.out");
60-
System.setIn(inStream);
61-
// System.setOut(outStream);
62-
}
63-
6454
Main main = new Main();
6555
main.solve();
6656
main.close();
67-
68-
if (isLocal) {
69-
inStream.close();
70-
// outStream.close();
71-
}
7257
}
7358
}

0 commit comments

Comments
 (0)