Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
806
Widok
0
08/01/2023 5:48 pm
Topic starter
example pom.xml
1 Answer
0
08/01/2023 5:51 pm
Topic starter
1. add dependency
<dependencies> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>3.1.0</version> <type>maven-plugin</type> </dependency> </dependencies>
2. configure plugin
<plugin> <artifactId>maven-antrun-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <phase>package</phase> <configuration> <target name="copy files into server"> <copy file="./target/MY_FILE.jar" todir="${server.plugin.directory}"/> <exec executable="C:\Program Files\Java\jdk-17.0.2\bin\java.exe" dir="MY_WORKING_DIR"> <arg value="-agentlib:jdwp=transport=dt_socket,server=n,address=pc1:5005,suspend=y"></arg> <arg line="-jar C:\MY_WORKING_DIR\paper-1.19-81.jar"></arg> <arg value="-nogui"></arg> </exec> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
3. create/start build configuration (when you click stop, app will stop eather)
4. agentlib:jdwp argument is for debbuger, start, set brekpoint and you're done :)
RUN & DEBUG
- create maven configuration
- set maven commands, example "clean package" (important for stages), set working directory
- create Remote JVM Debug with Listen to remove JVM
- FIRST START DEBUGGER (listener)
- then start Maven/project