修改文件列表结构
This commit is contained in:
@@ -1,83 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>game-parent</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>game-client</artifactId>
|
|
||||||
<name>Game Client</name>
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<!-- 依赖配置(无需写版本号,继承父模块) -->
|
|
||||||
<dependencies>
|
|
||||||
<!-- 依赖核心模块 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- libGDX桌面客户端依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-backend-lwjgl3</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-platform</artifactId>
|
|
||||||
<classifier>natives-desktop</classifier>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 测试依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<!-- 构建配置(生成可执行JAR) -->
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<!-- 编译插件(继承父模块版本) -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- 打包包含所有依赖的可执行JAR -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<descriptorRefs>
|
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
|
||||||
</descriptorRefs>
|
|
||||||
<archive>
|
|
||||||
<manifest>
|
|
||||||
<mainClass>com.example.client.DesktopLauncher</mainClass>
|
|
||||||
</manifest>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-assembly</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello 12!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
import com.badlogic.gdx.ApplicationListener;
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.graphics.GL20;
|
|
||||||
|
|
||||||
public class MyGdxGame implements ApplicationListener {
|
|
||||||
// 游戏初始化时调用
|
|
||||||
@Override
|
|
||||||
public void create() {
|
|
||||||
// 加载资源、初始化游戏对象
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 每次渲染时调用
|
|
||||||
@Override
|
|
||||||
public void render() {
|
|
||||||
// 清空屏幕
|
|
||||||
Gdx.gl.glClearColor(0, 0, 0, 1);
|
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
|
||||||
|
|
||||||
// 游戏逻辑更新和渲染
|
|
||||||
}
|
|
||||||
|
|
||||||
// 窗口大小改变时调用
|
|
||||||
@Override
|
|
||||||
public void resize(int width, int height) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 游戏暂停时调用(如Android上按下Home键)
|
|
||||||
@Override
|
|
||||||
public void pause() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 游戏恢复时调用
|
|
||||||
@Override
|
|
||||||
public void resume() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 游戏退出时调用,释放资源
|
|
||||||
@Override
|
|
||||||
public void dispose() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Rigorous Test :-)
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void shouldAnswerWithTrue()
|
|
||||||
{
|
|
||||||
assertTrue( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
39
core/pom.xml
39
core/pom.xml
@@ -1,39 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>game-parent</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<!-- 核心模块信息(无需重复groupId和version,继承自父模块) -->
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
<name>Game Core</name>
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<!-- 依赖配置(继承父模块的版本管理) -->
|
|
||||||
<dependencies>
|
|
||||||
<!-- 测试依赖(无需写版本号) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<!-- 构建配置(使用父模块定义的插件版本) -->
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<!-- 编译插件(继承父模块版本) -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Rigorous Test :-)
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void shouldAnswerWithTrue()
|
|
||||||
{
|
|
||||||
assertTrue( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
150
pom.xml
150
pom.xml
@@ -1,108 +1,56 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>uno.mloluyu</groupId>
|
||||||
<!-- 父模块基础信息 -->
|
<artifactId>game</artifactId>
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>game-parent</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Game Parent</name>
|
|
||||||
|
|
||||||
<!-- 子模块声明 -->
|
<dependencies>
|
||||||
<modules>
|
<dependency>
|
||||||
<module>core</module>
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
<module>client</module>
|
<artifactId>gdx</artifactId>
|
||||||
<module>server</module>
|
<version>1.12.1</version>
|
||||||
</modules>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
|
<artifactId>gdx-backend-lwjgl3</artifactId>
|
||||||
|
<version>1.12.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
|
<artifactId>gdx-platform</artifactId>
|
||||||
|
<version>1.12.1</version>
|
||||||
|
<classifier>natives-desktop</classifier>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<!-- 公共属性(子模块继承) -->
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
<maven.compiler.source>21</maven.compiler.source> <!-- Java 21 编译版本 -->
|
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
|
||||||
<gdx.version>1.12.1</gdx.version> <!-- libGDX版本 -->
|
|
||||||
<junit.version>4.13.2</junit.version> <!-- 统一JUnit版本 -->
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<!-- 统一管理依赖版本(子模块无需写版本) -->
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<!-- 项目内核心模块 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- libGDX相关依赖(仅client使用) -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx</artifactId>
|
|
||||||
<version>${gdx.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-backend-lwjgl3</artifactId>
|
|
||||||
<version>${gdx.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-platform</artifactId>
|
|
||||||
<version>${gdx.version}</version>
|
|
||||||
<classifier>natives-desktop</classifier>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 测试依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>${junit.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<!-- 统一管理插件版本 -->
|
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<plugins>
|
||||||
<plugins>
|
<plugin>
|
||||||
<!-- 编译插件(适配Java 21) -->
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<plugin>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<version>3.13.0</version>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<configuration>
|
||||||
<version>3.11.0</version> <!-- 支持Java 21的版本 -->
|
<source>21</source>
|
||||||
<configuration>
|
<target>21</target>
|
||||||
<source>${maven.compiler.source}</source>
|
<compilerArgs>--enable-preview</compilerArgs>
|
||||||
<target>${maven.compiler.target}</target>
|
</configuration>
|
||||||
</configuration>
|
</plugin>
|
||||||
</plugin>
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<!-- 可执行JAR打包插件 -->
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
<plugin>
|
<version>3.1.0</version>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<configuration>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<mainClass>uno.mloluyu.desktop.Launcher</mainClass> <!-- 替换为你的桌面启动器完整类名 -->
|
||||||
<version>3.3.0</version>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
</plugins>
|
||||||
<!-- 其他基础插件(统一版本) -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.3.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.3.1</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.3.0</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
</build>
|
||||||
</project>
|
|
||||||
<!---->
|
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<gdx.version>1.12.1</gdx.version>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>game-parent</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>server</artifactId>
|
|
||||||
<name>Game Server</name>
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<!-- 依赖配置 -->
|
|
||||||
<dependencies>
|
|
||||||
<!-- 依赖核心模块 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.example</groupId>
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 测试依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<!-- 构建配置(生成可执行JAR) -->
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<!-- 编译插件(继承父模块版本) -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- 打包包含所有依赖的可执行JAR -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<descriptorRefs>
|
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
|
||||||
</descriptorRefs>
|
|
||||||
<archive>
|
|
||||||
<manifest>
|
|
||||||
<mainClass>com.example.server.ServerLauncher</mainClass> <!-- 服务端主类 -->
|
|
||||||
</manifest>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-assembly</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Rigorous Test :-)
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void shouldAnswerWithTrue()
|
|
||||||
{
|
|
||||||
assertTrue( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user