Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions dat-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,29 +241,22 @@
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<!-- Deploy Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip> <!-- 跳过部署 -->
</configuration>
</plugin>
<!-- &lt;!&ndash; Central Publishing Plugin - 禁用扩展以跳过发布 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.sonatype.central</groupId>-->
<!-- <artifactId>central-publishing-maven-plugin</artifactId>-->
<!-- <extensions>false</extensions>-->
<!-- <configuration>-->
<!-- <skipPublishing>true</skipPublishing>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</pluginManagement>

<plugins>
<!-- Deploy Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip> <!-- 跳过部署 -->
</configuration>
</plugin>
</plugins>
</build>

<profiles>

<!-- central profile - 禁用 central-publishing-maven-plugin -->
<profile>
<id>central</id>
Expand Down
36 changes: 36 additions & 0 deletions dat-servers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,40 @@
<module>dat-server-mcp</module>
</modules>

<build>
<plugins>
<!-- Deploy Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip> <!-- 跳过部署 -->
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<!-- central profile - 禁用 central-publishing-maven-plugin -->
<profile>
<id>central</id>
<build>
<plugins>
<!-- 明确禁用 central-publishing-maven-plugin 的所有执行 -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<executions>
<execution>
<id>injected-central-publishing</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
95 changes: 85 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<connection>scm:git:https://github.com/junjiem/dat.git</connection>
<developerConnection>scm:git:ssh://git@github.com:junjiem/dat.git</developerConnection>
<url>https://github.com/junjiem/dat</url>
<tag>HEAD</tag>
</scm>

<issueManagement>
Expand Down Expand Up @@ -73,22 +74,82 @@
<logback.version>1.5.18</logback.version>
</properties>

<profiles>
<build>
<pluginManagement>
<plugins>
<!-- Deploy Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.4</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<!-- 打包时跳过测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
Comment on lines +91 to +98
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

⚠️ Critical: Test skipping in root pom affects all modules by default.

Configuring maven-surefire-plugin with <skip>true</skip> in the root pom's main build lifecycle will skip tests for all child modules unless they explicitly override this configuration. This breaks the standard Maven workflow where mvn clean package is expected to run tests.

This configuration should be moved to the central profile (lines 147–241) if tests should only be skipped during central deployment, or removed entirely if tests should always run.

Apply one of these fixes:

Option 1 (recommended): Move test skipping to the central profile only.

-        <plugins>
-            <!-- 打包时跳过测试 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>3.5.3</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>

Then add it inside the central profile's <build><plugins> section (around line 152):

+            <!-- 打包时跳过测试 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>3.5.3</version>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>

Option 2: Remove test skipping entirely and ensure tests always run.

-        <plugins>
-            <!-- 打包时跳过测试 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>3.5.3</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In pom.xml around lines 91 to 98, the root build config sets
maven-surefire-plugin with <skip>true</skip>, which causes all modules to skip
tests; move this skip configuration into the existing central profile's
build->plugins section (around lines 147–241) so tests are only skipped during
central deployment, or remove the <skip>true</skip> entry entirely if tests
should always run; ensure child modules inherit the root pom behavior correctly
or explicitly override if needed.

<!-- javadoc插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<!-- <failOnWarnings>false</failOnWarnings>-->
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
</configuration>
<reportSets>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
<reportSet>
<id>default</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>

<profiles>
<!-- Deploy to Maven Central -->
<profile>
<id>central</id>
<build>
<plugins>
<!-- 打包时跳过测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- compile插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -99,6 +160,20 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- source插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
Expand Down