{"id":10008312,"date":"2023-09-22T16:29:18","date_gmt":"2023-09-22T08:29:18","guid":{"rendered":"https:\/\/blog.itmax.cn\/?p=10008312"},"modified":"2023-09-22T16:29:18","modified_gmt":"2023-09-22T08:29:18","slug":"%e3%80%90%e6%95%88%e7%8e%87%e6%8f%90%e5%8d%87%e3%80%91maven-%e8%bd%ac-gradle-%e5%ae%9e%e6%88%98-%e4%ba%ac%e4%b8%9c%e4%ba%91%e6%8a%80%e6%9c%af%e5%9b%a2%e9%98%9f","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10008312","title":{"rendered":"\u3010\u6548\u7387\u63d0\u5347\u3011maven \u8f6c gradle \u5b9e\u6218 | \u4eac\u4e1c\u4e91\u6280\u672f\u56e2\u961f"},"content":{"rendered":"<h2>\u4e00\u3001\u7075\u9b42\u4e09\u95ee<\/h2>\n<h4>1\u3001gradle \u662f\u4ec0\u4e48\uff1f<\/h4>\n<p>\u4e00\u4e2a\u6253\u5305\u5de5\u5177\uff0c \u662f\u4e00\u4e2a\u5f00\u6e90\u6784\u5efa\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u8db3\u591f\u7075\u6d3b\uff0c\u53ef\u4ee5\u6784\u5efa\u51e0\u4e4e\u4efb\u4f55\u7c7b\u578b\u7684\u8f6f\u4ef6\uff0c\u9ad8\u6027\u80fd\u3001\u53ef\u6269\u5c55\u3001\u80fd\u6d1e\u5bdf\u7b49\u3002\u5176\u4e2d\u6d1e\u5bdf\uff0c\u53ef\u4ee5\u7528\u4e8e\u5206\u6790\u6784\u5efa\u8fc7\u7a0b\u4e2d\u6570\u636e\uff0c\u63d0\u4f9b\u5206\u6790\u53c2\u8003\uff0c\u65b9\u4fbf\u6392\u67e5\u95ee\u9898\u548c\u4e0d\u65ad\u4f18\u5316\u6784\u5efa\u6027\u80fd\uff0c\u4ee5\u4e0b\u4e00\u6b21\u7f16\u8bd1\u5206\u6790\u62a5\u544a\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000044249423\" alt=\"\" title=\"\"><\/p>\n<h4>2\u3001\u6709\u4ec0\u4e48\u4f18\u52bf<\/h4>\n<p>\u53c2\u8003\u5b98\u65b9\u6587\u7ae0\uff0c\u9488\u5bf9\u5305\u542b10 \u5b50\u6a21\u5757\u7684\u5de5\u7a0b\uff0c\u76f8\u5bf9 maven \u6784\u5efa\u901f\u5ea6\uff0c\u5927\u6982\u6709 2-3 \u500d\u7684\u6027\u80fd\u63d0\u5347\uff0c\u589e\u91cf\u7f16\u8bd1\u5927\u6982 7 \u500d\u7684\u6027\u80fd\u63d0\u5347\uff0c<a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=%2FGNlBbA0xDHM%2FcBAJPfnFA%3D%3D.0vkcwJcxTY1gPDXB32YBhueHBrL%2BfJFo1JnEquEoU3VsdrpMA8epkhpVbWvEzUK%2F\" rel=\"noopener noreferrer\">\u53c2\u8003\u5b98\u65b9<\/a><\/p>\n<p><strong>\u5b9e\u6d4b\u5bf9\u6bd4\uff1a<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th> <\/th>\n<th><strong>gradle \u8017\u65f6<\/strong><\/th>\n<th><strong>maven \u8017\u65f6<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5168\u65b0\u6784\u5efa\uff08clean \u53ca\u4e0b\u8f7d\u4f9d\u8d56\u5305\uff09<\/td>\n<td>1m 35s<\/td>\n<td>1m58s<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u65b0\u6784\u5efa\uff08clean\uff09<\/td>\n<td>43s<\/td>\n<td>60s<\/td>\n<\/tr>\n<tr>\n<td>\u589e\u91cf\u6784\u5efa<\/td>\n<td>14s<\/td>\n<td>43s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>gradle \u6267\u884c\u547d\u4ee4\uff1a time gradle clean build package -x test<\/p>\n<p>mvn \u6267\u884c\u7684\u547d\u4ee4\uff1a time mvn clean package -Dmaven.test.skip=true -f $(pwd) -T 1C -Dmaven.artifact.threads=16<\/p>\n<p>\u7efc\u8ff0\uff0c\u7ecf\u8fc7\u591a\u8f6e\u6d4b\u8bd5\uff0c\u5728\u589e\u91cf\u7f16\u8bd1\u573a\u666f\u4f18\u52bf\u6bd4\u8f83\u7a81\u51fa\u5e73\u5747\u6709 2 \u500d\u7684\u6027\u80fd\u63d0\u5347\uff0c\u5de5\u7a0b\u6a21\u5757\u8d8a\u591a\u6548\u7387\u63d0\u5347\u8d8a\u5927\u3002<\/p>\n<h4>3\u3001\u8fc1\u79fb\u662f\u5426\u5bb9\u6613<\/h4>\n<p>\u6478\u7740\u5fc3\u53e3\u8bf4\uff0c\u5e76\u4e0d\u5bb9\u6613\uff0c\u867d\u7136\u5b98\u65b9\u63d0\u4f9b\u4e86\u4e00\u952e\u8fc1\u79fb\u7684\u5de5\u5177\uff0c\u4f46\u662f\u8fd8\u662f\u6709\u4e00\u5b9a\u5b66\u4e60\u6210\u672c\uff0c\u4f46\u6539\u9020\u5b8c\u6210\u786e\u5b9e\u8282\u7701\u4e86\u5927\u628a\u7684\u65f6\u95f4\uff0c\u5c24\u5176\u662f\u6539\u4e86\u4e00\u4e24\u884c\u4ee3\u7801\u518d\u6b21\u7f16\u8bd1\u65f6\u3002<\/p>\n<h2>\u4e8c\u3001\u52a8\u52a8\u624b\u8bd5\u8bd5<\/h2>\n<h4>1\u3001\u5b89\u88c5 gradle<\/h4>\n<p>\u63a8\u8350\u4f7f\u7528 sdkman ,\u4e3b\u8981\u7528\u4e8e\u5de5\u5177\u591a\u7248\u672c\u7ba1\u7406\u7684\u5de5\u5177\uff0c\u5982 java \u3001gradle \u3001maven \u7b49\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u5b89\u88c5\u4f7f\u7528\u5176\u4e2d\u67d0\u4e2a\u4e00\u4e2a\u7248\u672c\uff0c\u5982jdk8\uff0cjdk11 \u7b49\uff0c\u7248\u672c\u95f4\u5207\u6362\u975e\u5e38\u7b80\u4fbf\u3002 <a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Ii8xKnweYFTxeGtIv8imVg%3D%3D.Gv7nVZmO5TgJqME72G3t%2F3UNaNa44NLPBUEwjrDcsKv8YyDIuDAOfAha5c0isdZR\" rel=\"noopener noreferrer\">sdk \u4ecb\u7ecd<\/a>\uff1a<\/p>\n<pre><code>sdk install  gradle 8.1.1\n\n<\/code><\/pre>\n<h4>2\u3001\u6267\u884c\u8fc1\u79fb\u547d\u4ee4<\/h4>\n<p>\u5728\u5f53\u524d maven \u5de5\u7a0b\u4e0b\uff0c\u6267\u884c\u5982\u4e0b\u7684\u547d\u4ee4\u3002<\/p>\n<pre><code>gradle init \nFound a Maven build. Generate a Gradle build from this? (default: yes) [yes, no] yes\nSelect build script DSL:\n  1: Groovy\n  2: Kotlin\nEnter selection (default: Groovy) [1..2] 1\nGenerate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] no\n\n<\/code><\/pre>\n<p>\u4e0d\u51fa\u610f\u5916\u4e0b\uff0c\u4f1a\u5728\u9ed8\u8ba4\u5b50\u6a21\u5757\u4e0b\u6dfb\u52a0 build.gradle \u6587\u4ef6\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000044249424\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><strong>\u6587\u4ef6\u89e3\u91ca\uff1a<\/strong><\/p>\n<p>1\uff09buildSrc\/main\/groovy\/com.jd.pegasus.java-conventions.gradle \uff1a\u91cc\u9762\u914d\u7f6e\u7684\u662f\u5185\u7f51\u79c1\u670d\u5e93\u5730\u5740\u3002<\/p>\n<pre><code>repositories {\n    mavenLocal()\n    maven {\n        url = uri('http:\/\/artifactory.jd.com\/libs-releases')\n\n        allowInsecureProtocol = true\n    }\n\n    maven {\n        url = uri('http:\/\/artifactory.jd.com\/libs-snapshots')\n\n         allowInsecureProtocol = true\n    }\n    maven {\n        url &quot;https:\/\/plugins.gradle.org\/m2\/&quot;\n    }\n\n}\n\n<\/code><\/pre>\n<p>2\uff09gradle.properties \uff1a\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5fc5\u987b\u8bbe\u7f6e jvm \u7684\u53c2\u6570\uff0c\u5426\u5219\u5f88\u5bb9\u6613 oom \u3002 <a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Q%2Bh54rhDAg%2BEjdRDUdc6%2Bw%3D%3D.JqtMR1eKgDajD49uSww%2Bj4l10TEXQPYY5RSjw72GK59HuZaJnSYzdnwApHLh4EzyjivZuTP4GgJPPygeUSz6Uw%3D%3D\" rel=\"noopener noreferrer\">\u66f4\u591a\u914d\u7f6e<\/a><\/p>\n<pre><code># gradle jvm \u8bbe\u7f6e\norg.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n# \u5f00\u542f\u5e76\u884c\u7f16\u8bd1\norg.gradle.parallel=true\n\n\n\n<\/code><\/pre>\n<p>3\uff09build.gradle \uff1a\u5305\u542b\u4e86\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u7684\u63d2\u4ef6\uff0cid &#8216;com.jd.pegasus.java-conventions&#8217; \u4ee3\u8868\u81ea\u5b9a\u4e49\u7684\u63d2\u4ef6\u3002 dependencies \u4e3a\u5de5\u7a0b\u6240\u4f7f\u7528\u7684\u4f9d\u8d56\u3002<\/p>\n<pre><code>plugins {\n    id 'com.jd.pegasus.java-conventions'\n}\n\ndependencies {\n    api project(':pegasus-service')\n    api project(':pegasus-common')\n    implementation 'org.springframework.boot:spring-boot:2.1.9.RELEASE'\n    api project(':component-metric')\n    testImplementation 'org.springframework.boot:spring-boot-starter-test:2.1.9.RELEASE'\n    annotationProcessor 'org.projectlombok:lombok:1.18.10'\n}\n\ndescription = 'pegasus-worker'\n\n<\/code><\/pre>\n<p>\u8fd9\u91cc\u9762\u6709\u4e00\u4e2adependencies \u4f9d\u8d56\u9879\u4e2d api \u4e0e implementation \u533a\u522b\uff0c\u53c2\u89c1\u5982\u4e0b\u89e3\u91ca\uff1a<\/p>\n<blockquote>\n<p>\u5047\u8bbe\u4f60\u6b63\u5728\u7ef4\u62a4\u4e00\u4e2a\u540d\u4e3a MyLibrary \u7684\u5e93\uff0c\u5b83\u4f9d\u8d56\u4e8e\u53e6\u4e00\u4e2a\u5e93 InternalLibrary\u3002\u4f60\u5e0c\u671b MyLibrary \u7684\u7528\u6237\u80fd\u591f\u4f7f\u7528 InternalLibrary \u4e2d\u7684\u67d0\u4e9b\u7c7b\u548c\u65b9\u6cd5\uff0c\u4f46\u4e0d\u5e0c\u671b\u4ed6\u4eec\u4f7f\u7528\u5176\u4ed6\u7c7b\u548c\u65b9\u6cd5\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u5728 MyLibrary \u7684 build.gradle \u6587\u4ef6\u4e2d\u4f7f\u7528 api \u914d\u7f6e\u6765\u58f0\u660e\u5bf9 InternalLibrary \u7684\u4f9d\u8d56\uff1a<\/p>\n<p>dependencies {<\/p>\n<p>api project(&#8216;:InternalLibrary&#8217;)<\/p>\n<p>}<\/p>\n<p>\u8fd9\u6837\uff0c\u5f53\u5176\u4ed6\u6a21\u5757\u4f9d\u8d56\u4e8e MyLibrary \u65f6\uff0c\u5b83\u4eec\u4e5f\u80fd\u591f\u8bbf\u95ee InternalLibrary \u4e2d\u7684\u7c7b\u548c\u65b9\u6cd5\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4e0d\u5e0c\u671b MyLibrary \u7684\u7528\u6237\u80fd\u591f\u8bbf\u95ee InternalLibrary \u4e2d\u7684\u4efb\u4f55\u5185\u5bb9\uff0c\u4f60\u53ef\u4ee5\u5728 MyLibrary \u7684 build.gradle \u6587\u4ef6\u4e2d\u4f7f\u7528 implementation \u914d\u7f6e\u6765\u58f0\u660e\u5bf9 InternalLibrary \u7684\u4f9d\u8d56\uff1a<\/p>\n<p>dependencies {<\/p>\n<p>implementation project(&#8216;:InternalLibrary&#8217;)<\/p>\n<p>}<\/p>\n<p>\u8fd9\u6837\uff0c\u5f53\u5176\u4ed6\u6a21\u5757\u4f9d\u8d56\u4e8e MyLibrary \u65f6\uff0c\u5b83\u4eec\u5c06\u65e0\u6cd5\u8bbf\u95ee InternalLibrary \u4e2d\u7684\u4efb\u4f55\u5185\u5bb9\u3002<\/p>\n<\/blockquote>\n<p>\u7b80\u5355\u70b9\u5c31\u662f\u5982\u679c\u4f60\u60f3\u628a\u4f60\u4f9d\u8d56\u7ec4\u4ef6\uff0c\u8ba9\u4f7f\u7528\u4f60\u7ec4\u4ef6\u4eba\u4e5f\u77e5\u9053\u7684\u660e\u660e\u767d\u767d\u7684\u4e5f\u80fd\u4f7f\u7528\uff0c\u90a3\u4f60\u5c31\u7528 api \u628a\u7ec4\u4ef6\u4f20\u9012\u4e0b\u53bb \uff0c\u53cd\u4e4b\u5c31\u7528 implementation \uff0c\u5c31\u81ea\u4e2a\u5077\u6478\u4f7f\u7528\u4e86\uff0c\u5bf9\u7b2c\u4e09\u65b9\u9690\u85cf\u4e86\u4e00\u4e9b\u5185\u90e8\u7ec6\u8282\u3002<\/p>\n<h4>3\u3001gitignore \u6392\u9664\u4e0d\u8981\u7684\u76ee\u5f55\u548c\u6587\u4ef6<\/h4>\n<pre><code># Gradle generated files\nbuild\/\n.gradle\/\n\/out\/\n\/.gradle\/\n\n<\/code><\/pre>\n<h4>4\u3001\u5141\u8bb8\u4ee5\u4e0d\u5b89\u5168\u7684\u65b9\u5f0f\u8bbf\u95ee\u79c1\u670d\u5e93<\/h4>\n<pre><code># \u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\uff0cbuildSrc\/main\/groovy\/com.jd.pegasus.java-conventions.gradle \n\nrepositories {\n    mavenLocal()\n    maven {\n        url = uri('http:\/\/artifactory.jd.com\/libs-releases')\n\n        allowInsecureProtocol = true\n    }\n}\n\n\n\n<\/code><\/pre>\n<h4>5\u3001\u89e3\u51b3 lombok \u5f15\u53d1\u7684\u7f16\u8bd1\u95ee\u9898<\/h4>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000044249425\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u901a\u8fc7 lombok \u6ce8\u89e3\u4f1a\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u628a\u6ce8\u89e3\u7684\u7c7b\u8fdb\u884c\u6269\u5c55\uff0c\u6dfb\u52a0 get \u3001set \u3001toString \u65b9\u6cd5\u7b49\u3002<\/p>\n<pre><code># \u5728\u7f16\u8bd1\u51fa\u9519\u7684\u6a21\u5757\u91cc\u9762 build.gradle \u6587\u4ef6\u4e2d\u6dfb\u52a0\u6ce8\u89e3\u5904\u7406\u5668\uff0cannotationProcessor  \u5982\u4e0b\uff1a\ndependencies {\n    api project(':pegasus-service')\n    annotationProcessor 'org.projectlombok:lombok:1.18.10'\n}\n\n<\/code><\/pre>\n<h4>6\u3001\u89e3\u51b3\u7248\u672c\u4f9d\u8d56\u51b2\u7a81<\/h4>\n<p>\u7248\u672c\u51b2\u7a81\u6307\u540c\u4f9d\u8d56\u7ec4\u4ef6\u51fa\u73b0\u4e0d\u540c\u7684\u7248\u672c\u60c5\u51b5\uff0c\u5982pegasus-common \u6a21\u5757\u4f9d\u8d56\u7684 fastjson \u67091.2.83-jdsec.rc1, 1.2.29 and 1.2.12 \u4e09\u4e2a\u7248\u672c\uff0cgradle \u4f1a\u81ea\u52a8\u5904\u7406\u4ef2\u88c1\uff0c\u89c4\u5219\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<p>1\uff09\u51b2\u7a81\u65f6\u4f1a\u9ed8\u8ba4\u91c7\u7528\u6700\u65b0\u7684\u7248\u672c\u3002<\/p>\n<p>2\uff09\u901a\u8fc7 strictly \u6807\u8bb0\u4e3b\u8981\u7528\u4e8e\u964d\u7ea7\u5230\u6307\u5b9a\u7684\u7248\u672c\uff0c\u5982\u4f20\u9012\u4f9d\u8d56\u5f15\u5165\u7684\u7248\u672c\u9ad8\uff0c\u5f53\u524d\u7248\u672c\u4e0d\u517c\u5bb9\uff0c\u90a3\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u5173\u952e\u5b57\u8bbe\u7f6e\u6307\u5b9a\u7684\u7248\u672c\u3002<\/p>\n<pre><code>implementation('com.alibaba:fastjson'){   \n  version{       \n    strictly(&quot;1.2.12&quot;)    \n  } \n}\n\u6216\u8005\u7b80\u5199\u4e3a \nimplementation 'com.alibaba:fastjson:1.2.29!!!'\n\n<\/code><\/pre>\n<p>3\uff09force \u7684\u4f18\u5148\u7ea7\u4f1a\u6bd4\u8f83\u9ad8\uff0c\u4f1a\u8986\u76d6 strictly \u7b56\u7565<\/p>\n<pre><code>configurations.all {\n    resolutionStrategy {\n        \/\/ \u5728\u8fd9\u91cc\u5b9a\u4e49\u60a8\u7684\u4f9d\u8d56\u89e3\u6790\u89c4\u5219\n        \/\/force 'com.alibaba:fastjson:1.2.12'\n    }\n}\n\n<\/code><\/pre>\n<p>\u6392\u67e5\u67d0\u4e2a\u6a21\u5757\u7684\u4f9d\u8d56\u51b2\u7a81<\/p>\n<pre><code>gradle :pegasus-common:dependencyInsight --configuration compileClasspath --dependency com.alibaba:fastjson\n\n<\/code><\/pre>\n<h4>7\u3001\u5982\u4f55\u6784\u5efa zip \u5305<\/h4>\n<p>\u4ee5 springboot \u4e3a\u4f8b\uff0c\u53c2\u8003\u5982\u4e0b\u4ee3\u7801\u5373\u53ef\uff0c\u5728\u5b50\u5de5\u7a0b build.gradle \u6587\u4ef6\u91cc\u3002<\/p>\n<pre><code>\u3002\nplugins {\n    id 'com.jd.pegasus.java-conventions'\n    \/\/ \u5f15\u5165springboot \u63d2\u4ef6\n    id 'org.springframework.boot' version '2.5.6'\n}\n\n\/\/ \u6307\u5b9a jar \u542f\u52a8\u7684\u5165\u53e3\u51fd\u6570\nbootJar {\n    manifest {\n        attributes 'Main-Class': 'com.jd.pegasus.Application'\n    }\n}\n\/\/ \u6784\u5efa zip \u538b\u7f29\u5305\uff0c\u5305\u542b\u542f\u52a8\u811a\u672c bin \u76ee\u5f55\u548c \u914d\u7f6e\u6587\u4ef6 conf \u76ee\u5f55\ntask packageZip(type: Zip) {\n    archiveFileName = &quot;${project.name}-${project.version}.zip&quot;\n    destinationDirectory = file(&quot;${project.buildDir}&quot;)\n\n    from(&quot;${project.projectDir}\/src\/main\/bin&quot;) {\n        into &quot;bin&quot;\n    }\n    from(&quot;${project.buildDir}\/resources\/main\/conf&quot;) {\n        into &quot;conf&quot;\n    }\n\n    from(&quot;${project.buildDir}\/libs\/${project.name}-${project.version}.jar&quot;) {\n        into &quot;lib&quot;\n    }\n    \/\/ \u8868\u793a\u6b64\u4efb\u52a1\u7684\u8fd0\u884c\u4f9d\u8d56\u5176\u5b83 \u5b50\u4efb\u52a1\u3002\n    dependsOn bootJar\n    dependsOn build\n}\n\n<\/code><\/pre>\n<h2>8\u3001\u6267\u884c\u6784\u5efa\u547d\u4ee4<\/h2>\n<pre><code># -x test \u6392\u9664\u5355\u6d4b\ngradle clean  build package -x test  \n\n<\/code><\/pre>\n<h3>\u4e09\u3001\u9644\u5f55\u53c2\u8003<\/h3>\n<ol>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=APgPRAI7T19TIf%2Fle6%2Fc4A%3D%3D.V3JNy5ouuPPxFYXEvRehgCg%2BBoU5Z28jx8HKd%2BPIbHsK%2FhSEPZHX9SsbPFwnwlL7YXEFXBjWi9tnwaXcOCLOEQ%3D%3D\" rel=\"noopener noreferrer\">\u4e00\u6587\u641e\u61c2Gradle\u7684\u4f9d\u8d56\u7ba1\u7406\u548c\u7248\u672c\u51b3\u8bae<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=%2BX%2F4XppgOanUTDxmx5T25w%3D%3D.jR%2BT%2B%2FkPZoIISWycvD7cqsa9d0iEHAE7CgVou%2FbB6kCf510wehdGW1JUMOPgPwSx\" rel=\"noopener noreferrer\">gradle \u4e0e maven \u6027\u80fd\u5bf9\u6bd4<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=bLM4hUXAOCmmWPOCohpGhg%3D%3D.FjAV0DTPU7uVsG4UNS7bm0AwrgXsq8y6C1X3G1sbHcUBVI0fZqg%2BFXX7gtKmxfF6\" rel=\"noopener noreferrer\">\u722c\u5751\u6307\u5357 &#8212; \u7406\u89e3 Plugin\u3001Task\u3001\u6784\u5efa\u6d41\u7a0b<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=eW59HuZzMv13fxiVwOP5oA%3D%3D.4ExVBQY%2Bb7ihdtKNBfRVB%2Br%2BXKgvHZGNGVzRkh5kvEmbHvMrk6BrmA6JFoGWPahN\" rel=\"noopener noreferrer\">\u5982\u4f55\u5b9a\u4f4d\u548c\u89e3\u51b3\u4f9d\u8d56\u51b2\u7a81<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=Eay1Ub1OmarDjf7h2Qf4gw%3D%3D.9FfwRWYLimXuJ7t1NliT5WOmaWZBTYJ6V0ajlXvJJU8%2BFRxTU2OPM6LORF3ZC%2BAY\" rel=\"noopener noreferrer\">Gradle\u4f9d\u8d56\u4e4b\u2018\u4e94\u79cd\u4f9d\u8d56\u914d\u7f6e\u2019<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=rohuz7hRlYrMTXCoa0Jjow%3D%3D.RX5dCsRCHQ0NL7fXklMh9LtHpTd1fES%2BCYZYCQvCNRkBedCfKpZDr9cOGmYzlqoB0HJhp8HDfwWnJNZYZJ%2BcWv0LXGJIGXadOZo4WEBJGpU%3D\" rel=\"noopener noreferrer\">Migrating Builds From Apache Maven<\/a><\/li>\n<\/ol>\n<p>\u540e\u8bb0\uff1a<\/p>\n<p>\u542c\u8bf4 maven \u4e0d\u7518\u5bc2\u5bde\uff0c\u7531 gradle \u548c Takari \u7684\u7075\u611f\uff0c\u505a\u4e86\u4e00\u4e2a\u5b88\u62a4\u7684 mvnd \uff0c\u5728\u589e\u91cf\u7f16\u8bd1\u573a\u666f\u6548\u7387\u6760\u6760\u7684\uff0c\u6709\u65f6\u95f4\u6d4b\u8bd5\u5bf9\u6bd4\u4e0b\u3002 <a target=\"_blank\" href=\"https:\/\/link.segmentfault.com\/?enc=NJZzSWwbEb0P%2BODej7x09Q%3D%3D.Voem8Fp5NAPWKmVcvsbkqHr7UKQU6ksyLlc20NYozo9siLXFdOn21CdoUHh8yQDs\" rel=\"noopener noreferrer\">mvnd \u53c2\u8003<\/a><\/p>\n<blockquote><p>\u4f5c\u8005\uff1a\u4eac\u4e1c\u79d1\u6280 \u5b81\u5229\u5e7f  <br \/>\u6765\u6e90\uff1a\u4eac\u4e1c\u4e91\u5f00\u53d1\u8005\u793e\u533a \u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u6e90<\/p><\/blockquote>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000044249421\">https:\/\/segmentfault.com\/a\/1190000044249421<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7075\u9b42\u4e09\u95ee 1\u3001gradle \u662f\u4ec0\u4e48\uff1f \u4e00\u4e2a\u6253\u5305\u5de5\u5177\uff0c \u662f\u4e00\u4e2a\u5f00\u6e90\u6784\u5efa\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u8db3\u591f\u7075\u6d3b\uff0c\u53ef\u4ee5\u6784\u5efa\u51e0\u4e4e\u4efb\u4f55 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10008312","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10008312"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10008312\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10008312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10008312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10008312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}