_xiaomin_
本帖最后由 _xiaomin_ 于 2022-8-9 15:28 编辑

gradle项目怎么构建?
有IDEA,构建之后插件是生成在什么地方

https://github.com/oraxen/oraxen


洞穴夜莺
./gradlew build命令,生成在build/libs

残影君
先下载个gradle https://gradle.org/
然后在文件路径前面输入cmd(空格),然后回车跳出命令提示符
输入gradlew.build
等待构建完成后在build文件夹找

_xiaomin_
洞穴夜莺 发表于 2022-8-9 00:33
./gradlew build命令,生成在build/libs

等他构建完后,没有在build(包括子目录)里面生成如何.jar文件

_xiaomin_
残影君 发表于 2022-8-9 02:55
先下载个gradle https://gradle.org/
然后在文件路径前面输入cmd(空格),然后回车跳出命令提示符
输入gradl ...

等他构建完后,没有在build(包括子目录)里面生成如何.jar文件

洞穴夜莺
_xiaomin_ 发表于 2022-8-9 14:32
等他构建完后,没有在build(包括子目录)里面生成如何.jar文件

那你build过程输出了啥?

_xiaomin_
洞穴夜莺 发表于 2022-8-9 15:38
那你build过程输出了啥?

上面有图片

洞穴夜莺

我构建了一下,生成了build/libs/oraxen-1.139.0.jar

_xiaomin_
洞穴夜莺 发表于 2022-8-9 16:40
我构建了一下,生成了build/libs/oraxen-1.139.0.jar

为何我连build/libs都没有。。

洞穴夜莺
_xiaomin_ 发表于 2022-8-9 16:41
为何我连build/libs都没有。。

你似乎执行的不是build任务,请在插件目录下在Powershell(Windows)或终端模拟器(Linux)中执行./gradlew build命令

_xiaomin_
洞穴夜莺 发表于 2022-8-9 16:51
你似乎执行的不是build任务,请在插件目录下在Powershell(Windows)或终端模拟器(Linux)中执行./gradl ...



PS C:\Users\xm227\Desktop\oraxen-1.51.0> ./gradlew build
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve com.sk89q.worldguard:worldguard-bukkit:LATEST.
     Required by:
         project :
      > No matching variant of com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT:20220312.223410-2 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
          - Variant 'apiElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
          - Variant 'javadocElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'runtimeElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
          - Variant 'sourcesElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
   > Could not resolve com.sk89q.worldguard:worldguard-bukkit:+.
     Required by:
         project :
      > No matching variant of com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT:20220312.223410-2 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, and its dependencies declared externally but:
          - Variant 'apiElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
          - Variant 'javadocElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'runtimeElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
          - Variant 'sourcesElements' capability com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/us ... mmand_line_warnings

BUILD FAILED in 22s
1 actionable task: 1 executed


洞穴夜莺
_xiaomin_ 发表于 2022-8-9 17:01
PS C:%users\xm227\Desktop\oraxen-1.51.0> ./gradlew build
> Task :compileJava FAILED

请更新你的Java版本到Java17以上

_xiaomin_
洞穴夜莺 发表于 2022-8-9 17:02
请更新你的Java版本到Java17以上

哦,我忘了,忘记改环境变量了

_xiaomin_
洞穴夜莺 发表于 2022-8-9 17:02
请更新你的Java版本到Java17以上

这又是什么


> Task :compileJava
C:\Users\xm227\Desktop\oraxen-1.51.0\src\main\java\io\th0rgal\oraxen\mechanics\provided\bedrockbreak\BedrockBreakMechanicManager.java:45: 错误: 在相应的 try 语句主体中不能抛出异常错误InvocationTargetException
        } catch (InvocationTargetException e) {
          ^
C:\Users\xm227\Desktop\oraxen-1.51.0\src\main\java\io\th0rgal\oraxen\pack\upload\hosts\Sh.java:40: 警告: [removal] java.lang 中的 SecurityManager 已过时, 且标记为待删除
        final SecurityManager sm = System.getSecurityManager();
              ^
C:\Users\xm227\Desktop\oraxen-1.51.0\src\main\java\io\th0rgal\oraxen\pack\upload\hosts\Sh.java:40: 警告: [removal] System 中的 getSecurityManager() 已过时, 且标记为待删除
        final SecurityManager sm = System.getSecurityManager();
                                         ^
C:\Users\xm227\Desktop\oraxen-1.51.0\src\main\java\io\th0rgal\oraxen\pack\upload\hosts\Sh.java:45: 警告: [removal] java.security 中的 AccessController 已过时, 且标记为待删除
                return AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> run(builder));
                       ^
1 个错误
3 个警告

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed with exit code 1; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/us ... mmand_line_warnings

BUILD FAILED in 1m 46s
1 actionable task: 1 executed

_xiaomin_
洞穴夜莺 发表于 2022-8-9 16:40
我构建了一下,生成了build/libs/oraxen-1.139.0.jar

要不你直接把插件发我把

洞穴夜莺
_xiaomin_ 发表于 2022-8-9 18:15
要不你直接把插件发我把

https://wwm.lanzouv.com/iyx7B099xi1g
密码:c8sh

_xiaomin_
洞穴夜莺 发表于 2022-8-9 19:27
https://wwm.lanzouv.com/iyx7B099xi1g
密码:c8sh

我自己已经构建了,谢谢

第一页 上一页 下一页 最后一页