Open DingliZhang opened 2 months ago
@DingliZhang 张老师我想尝试一下这个任务,目前构建地址为 OBS 不知是否已经成功?
@DingliZhang 张老师我想尝试一下这个任务,目前构建地址为 OBS 不知是否已经成功?
感谢尝试!看样子OBS这个构建虽然install了jdk11,但其实还是用的jdk8进行构建的,使用高版本的jdk通常需要显式添加BuildRequires,并在build过程中增加环境变量或JAVA_HOME参数,例: https://gitee.com/src-openeuler/jboss-logmanager/commit/25db75efc5918b95db5bf33fbce83290b48957d5 中的:
#set openjdk11 for build
export JAVA_HOME=%{_jvmdir}/java-11-openjdk
可以参考之前 https://build.tarsier-infra.isrc.ac.cn/package/show/openEuler:24.03/resteasy ,换用jdk11应该会减少一个数量级的构建时间,供参考。
另外添加了pom.xml中没有的mvn依赖的话,需要在prep阶段使用%pom_add_dep来进行处理,例如: https://gitee.com/src-openeuler/wildfly-core/pulls/27/commits
这里有官方的文档可以参考下: https://docs.fedoraproject.org/en-US/howto/
好的,谢谢张老师指点,我在修复完善一下!
定立老师, 由于x86_64编译时间更短, 我先尝试在ebs上进行构建, 遇到问题还想请教一下
ebs软件包地址: yangfanrani:openEuler-24.03-LTS:resteasy 软件源: openEuler-24.03-LTS系列(上述ebs软件包中可查看) 个人fork用于构建的git仓库: yangfan-ruan/resteasy
package javax.activation does not exist
和package javax.xml.bind.annotation does not exist
, 以及Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project resteasy-jaxrs
BuildRequires: java-11-openjdk-devel
Requires: java-11-openjdk
export JAVA_HOME=%{_jvmdir}/java-11-openjdk
具体报错如下
```bash
2024-10-12 17:51:19 [ERROR] COMPILATION ERROR :
2024-10-12 17:51:19 [INFO] -------------------------------------------------------------
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[25,24] package javax.activation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[40,64] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[105,18] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[170,37] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[170,11] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[212,24] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[43,58] cannot find symbol
2024-10-12 17:51:19 symbol: class DataSource
2024-10-12 17:51:19 location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[5,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[6,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[7,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[16,2] cannot find symbol
2024-10-12 17:51:19 symbol: class XmlRootElement
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[17,2] cannot find symbol
2024-10-12 17:51:19 symbol: class XmlAccessorType
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[17,18] cannot find symbol
2024-10-12 17:51:19 symbol: variable XmlAccessType
...
2024-10-12 17:51:19 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project resteasy-jaxrs: Compilation failure: Compilation failure:
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[25,24] package javax.activation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[40,64] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[105,18] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[170,37] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[170,11] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[212,24] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java:[43,58] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class DataSource
2024-10-12 17:51:19 [ERROR] location: class org.jboss.resteasy.plugins.providers.DataSourceProvider
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[5,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[6,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[7,33] package javax.xml.bind.annotation does not exist
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[16,2] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class XmlRootElement
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[17,2] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: class XmlAccessorType
2024-10-12 17:51:19 [ERROR] /root/rpmbuild/BUILD/Resteasy-3.0.19.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/api/validation/ResteasyConstraintViolation.java:[17,18] cannot find symbol
2024-10-12 17:51:19 [ERROR] symbol: variable XmlAccessType
2024-10-12 17:51:19 [ERROR] -> [Help 1]
2024-10-12 17:51:19 [ERROR]
2024-10-12 17:51:19 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2024-10-12 17:51:19 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2024-10-12 17:51:19 [ERROR]
2024-10-12 17:51:19 [ERROR] For more information about the errors and possible solutions, please read the following articles:
2024-10-12 17:51:19 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
2024-10-12 17:51:19 [ERROR]
2024-10-12 17:51:19 [ERROR] After correcting the problems, you can resume the build with the command
2024-10-12 17:51:19 [ERROR] mvn <args> -rf :resteasy-jaxrs
对于package javax.activation does not exist
与package javax.xml.bind.annotation does not exist
, 参考
%pom_add_dep javax.activation:activation:1.1.1
%pom_add_dep javax.xml.bind:jaxb-api:2.3.0
%pom_add_dep com.sun.xml.bind:jaxb-core:2.3.0
%pom_add_dep com.sun.xml.bind:jaxb-impl:2.3.0
报错并没有变化
添加`BuildRequires: mvn(javax.activation:activation)报错找不到这个包
添加jakarta.activation
不报错(资料里说这是javax.activation在更高版本JDK的替代), 但是构建依然失败,报错package javax.activation does not exist
依然存在
BuildRequires: mvn(jakarta.activation:jakarta.activation-api)
`%pom_add_dep com.sun.activation:javax.activation:1.2.0
在 maven central repository 寻找所有与javax.activation
有关的包(共13个), 添加其依赖
BuildRequires: mvn(one.gfw:javax.activation-api)
BuildRequires: mvn(javax.activation:javax.activation-api)
BuildRequires: mvn(com.sun.activation:javax.activation)
BuildRequires: mvn(org.glassfish:javax.activation)
BuildRequires: mvn(org.eclipse.jetty.orbit:javax.activation)
BuildRequires: mvn(org.apache.sling:org.apache.sling.javax.activation)
BuildRequires: mvn(javax.activation:activation)
BuildRequires: mvn(com.guicedee.services:javax.activation)
BuildRequires: mvn(org.kie.modules:javax-activation-api-main)
BuildRequires: mvn(com.github.livesense:org.liveSense.fragment.javax.activation-jre-1.6)
BuildRequires: mvn(org.wso2.orbit.javax.activation:activation)
BuildRequires: mvn(com.jwebmp.thirdparty:javax.activation)
BuildRequires: mvn(eu.ocathain.javax.activation:activation)
%pom_add_dep one.gfw:javax.activation-api:1.2.0
%pom_add_dep javax.activation:javax.activation-api:1.2.0
%pom_add_dep com.sun.activation:javax.activation:1.2.0
%pom_add_dep org.glassfish:javax.activation:10.0-b28
%pom_add_dep org.eclipse.jetty.orbit:javax.activation:1.1.0.v201105071233
%pom_add_dep org.apache.sling:org.apache.sling.javax.activation:0.3.0
%pom_add_dep javax.activation:activation:1.1.1
%pom_add_dep com.guicedee.services:javax.activation:1.2.2.1-jre17
%pom_add_dep org.kie.modules:javax-activation-api-main:6.5.0.Final
%pom_add_dep com.github.livesense:org.liveSense.fragment.javax.activation-jre-1.6:1.0.5
%pom_add_dep org.wso2.orbit.javax.activation:activation:1.1.1.wso2v4
%pom_add_dep com.jwebmp.thirdparty:javax.activation:0.68.0.1
%pom_add_dep eu.ocathain.javax.activation:activation:1.1.1
当BuildRequires:
部分添加时,构建很快停止,报错上述13个包全部找不到
当只添加%pom_add_dep
部分时, 报错package javax.activation does not exist
依然存在
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project resteasy-jaxrs
尝试使用更新插件的办法(版本在 maven central repository 确认)
%pom_remove_plugin -r :maven-compiler-plugin
%pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin:3.13.0
依然无效
javax.activation
等包呢javax.activation
等包也需要先用gdk11编译一下吗@yangfan-ruan 可以参考下 https://gitee.com/src-openeuler/wildfly-core/pulls/27/files 这里添加了 :
BuildRequires: mvn(org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec)`
有几点可以考虑一下:
mvn(xxx)
这种形式的BuildRequires
需要是oe的软件源里所提供的,可以在oe上这么查询:
$ dnf repoquery --whatprovides "mvn(javax.servlet:javax.servlet-api)"
Last metadata expiration check: 0:04:37 ago on Fri Oct 18 03:29:57 2024.
glassfish-servlet-api-0:3.1.0-17.oe2403.noarch
jakarta-servlet-0:5.0.0-4.oe2403.noarch
所以要自己判断所需要的依赖oe中是否存在,不存在的话考虑去引入。
mvn(xxx)
这种形式的BuildRequires
需要项目的源码包的pom.xml文件中已经有对应的依赖,如果没有需要%pom_add_dep
添加,可以参考:https://docs.fedoraproject.org/en-US/java-packaging-howto/
maven中相关的软件是从项目中给定的软件源安装的,还是从maven自己的源(比如 maven central repository )安装的?
这个可以看两个方面,如果一个maven构建的项目中的spec文件中的%build阶段是使用%mvn_build
的,那么他的maven相关的依赖就需要是oe软件源中已存在的,以 BuildRequires: mvn(xxx)
这种形式引用;如果%build阶段是直接使用mvn
命令构建的,那么就和普通的maven项目一样是从maven central repo中拉取的依赖。
是不是除了%pom_add_dep, 还有一些别的操作我没有添加导致迟迟找不到javax.activation等包呢
这个需要自己判断一下,看看需要在BuildRequires中添加哪些包同时pom.xml是否需要修改。
或者是javax.activation等包也需要先用gdk11编译一下吗
不需要,Java是向后兼容的。举个例子,比如说 resteasy 构建需要用到 javax.activation,那么构建 resteasy 的JDK版本大于等于 javax.activation的JDK版本即可。
定立老师, 我在oe-2403本地没有找到javax.activation相关的软件包, 但听了你的提示,我想起构建的log中出现过一个链接: https://repo.huaweicloud.com/repository/maven/ 在这个 https://repo.huaweicloud.com/repository/maven/javax.activation/activation/ 路径下我看见了想要的 javax.activation依赖: 这个仓库我检查过和oe-2403本地是不一样的,相同的软件包用的是不同的名称,是不是可以用这个路径做引入? ebs上面的地基工程里面并没有这个选项, 工程配置里添加这个路径作为软件源也没有见效, 我可以有哪些方式引入呢?
定立老师, 我在oe-2403本地没有找到javax.activation相关的软件包, 但听了你的提示,我想起构建的log中出现过一个链接: https://repo.huaweicloud.com/repository/maven/ 在这个 https://repo.huaweicloud.com/repository/maven/javax.activation/activation/ 路径下我看见了想要的 javax.activation依赖: 这个仓库我检查过和oe-2403本地是不一样的,相同的软件包用的是不同的名称,是不是可以用这个路径做引入? ebs上面的地基工程里面并没有这个选项, 工程配置里添加这个路径作为软件源也没有见效, 我可以有哪些方式引入呢?
dnf repoquery --whatprovides "mvn(com.sun.activation:jakarta.activation)"
Last metadata expiration check: 0:27:15 ago on Mon Oct 21 03:46:44 2024.
jakarta-activation-0:1.2.2-1.oe2403.noarch
可以试一下添加 mvn(com.sun.activation:jakarta.activation)
同时看看是否需要同时添加相关的 %pom_add_dep
,或者看看是不是需要升级源码包或者修改下源码。
软件包信息
软件包名称: resteasy
openEuler 仓库地址: https://gitee.com/src-openeuler/resteasy
构建仓库地址:
说明
问题背景: 目前 oerv 这边正在联合社区推出将 jdk11 作为默认的 jdk。注意下游软件包依赖问题。
所需技能:
其它: