Bug 277054 - net-im/openfire: Update to 4.8.0
Summary: net-im/openfire: Update to 4.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Fernando Apesteguía
URL: https://download.igniterealtime.org/o...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-14 18:12 UTC by Nikita Druba
Modified: 2024-05-21 15:48 UTC (History)
4 users (show)

See Also:
fernape: merge-quarterly+


Attachments
git diff for net-im/openfire (16.60 KB, patch)
2024-02-14 18:12 UTC, Nikita Druba
nikita: maintainer-approval+
Details | Diff
Poudriere log for failing build (25.07 KB, text/plain)
2024-04-03 10:18 UTC, Fernando Apesteguía
no flags Details
Fix build in clean environment (17.34 KB, patch)
2024-05-17 17:59 UTC, Fernando Apesteguía
fernape: maintainer-approval? (nikita)
Details | Diff
git diff for net-im/openfire (17.12 KB, patch)
2024-05-21 13:02 UTC, Nikita Druba
nikita: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Druba 2024-02-14 18:12:52 UTC
Created attachment 248465 [details]
git diff for net-im/openfire

Changelog:
https://download.igniterealtime.org/openfire/docs/4.8.0/changelog.html

P.S. For this port needed to upload to some server archive with local maven repository:
https://cloud.druba.su/s/caw9Ak9DE5e3fQm/download/FreeBSD-openfire-4.8.0-maven-repository.tar.gz
Comment 1 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2024-03-02 13:38:09 UTC
As Fernape needs to upload the packages so assigning accordingly.
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2024-03-03 08:36:37 UTC
It looks like the build process tries to access the network out of the fetch stage, which is not allowed:

[ERROR] Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace (utf8-to-latin1) on project i18n: Execution utf8-to-latin1 of goal org.codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace failed: Plugin org.codehaus.mojo:native2ascii-maven-plugin:2.0.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.ow2.asm:asm:jar:5.0.2, org.ow2.asm:asm-commons:jar:5.0.2: Cannot access igniterealtime (https://igniterealtime.org/archiva/repository/maven/) in offline mode and the artifact org.ow2.asm:asm:jar:5.0.2 has not been downloaded from it before. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Comment 3 Nikita Druba 2024-03-29 19:20:48 UTC
(In reply to Fernando Apesteguía from comment #2)
Hi! I'm sorry for the delay. I created this bug before going on vacation.
The file it is trying to find (org.ow2.asm:asm:jar:5.0.2) is in archive from bug description. Archive must be accessible. Previously it was LOCAL/fernape.

I repeated build tests in my x86 and x64 jails and openfire successfully builds with default options.
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2024-03-30 09:16:25 UTC
(In reply to Nikita Druba from comment #3)
The file is uploaded as it was for previous versions and the file is fetched properly:

=======================<phase: fetch          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
===>  License APACHE20 accepted by the user
===>   openfire-4.8.0,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openfire-4.8.0,1 for building
===========================================================================
=======================<phase: checksum       >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
===>  License APACHE20 accepted by the user
===>   openfire-4.8.0,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openfire-4.8.0,1 for building
=> SHA256 Checksum OK for FreeBSD-openfire-4.8.0-maven-repository.tar.gz.
=> SHA256 Checksum OK for igniterealtime-Openfire-v4.8.0_GH0.tar.gz.

But then, the same error happens:

[ERROR] Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace (utf8-to-latin1) on project i18n: Execution utf8-to-latin1 of goal org.codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace failed: Plugin org.codehaus.mojo:native2ascii-maven-plugin:2.0.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.ow2.asm:asm:jar:5.0.2, org.ow2.asm:asm-commons:jar:5.0.2: Cannot access igniterealtime (https://igniterealtime.org/archiva/repository/maven/) in offline mode and the artifact org.ow2.asm:asm:jar:5.0.2 has not been downloaded from it before. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :i18n
*** Error code 1

Comparing the logs for 4.7.5 and 4.8.0, I see that there is more processing for 4.7.5, i.e:
[INFO] Excludes: []
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n.properties' to: '/tmp/openfire_i18n.properties2601183940646520440native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pl_PL.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pl_PL.properties' to: '/tmp/openfire_i18n_pl_PL.properties5313423439987517763native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pl_PL.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_zh_CN.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_zh_CN.properties' to: '/tmp/openfire_i18n_zh_CN.properties4094069592949480122native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_zh_CN.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_nl.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_nl.properties' to: '/tmp/openfire_i18n_nl.properties80931377765668465native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_nl.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_sk.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_sk.properties' to: '/tmp/openfire_i18n_sk.properties890219086046776498native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_sk.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_es.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_es.properties' to: '/tmp/openfire_i18n_es.properties4834968450695834859native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_es.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_BR.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_BR.properties' to: '/tmp/openfire_i18n_pt_BR.properties6879916263533315552native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_BR.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_cs_CZ.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_cs_CZ.properties' to: '/tmp/openfire_i18n_cs_CZ.properties1071165442050723498native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_cs_CZ.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_fr.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_fr.properties' to: '/tmp/openfire_i18n_fr.properties4386413390719713283native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_fr.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_PT.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_PT.properties' to: '/tmp/openfire_i18n_pt_PT.properties4003546588021885044native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_pt_PT.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ja_JP.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ja_JP.properties' to: '/tmp/openfire_i18n_ja_JP.properties3244868049282925789native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ja_JP.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_de.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_de.properties' to: '/tmp/openfire_i18n_de.properties3454893326709612528native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_de.properties
[INFO] Processing /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ru_RU.properties
[INFO] Converting: '/wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ru_RU.properties' to: '/tmp/openfire_i18n_ru_RU.properties4638212297751425021native2ascii'
[INFO] File converted successfuly: /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.7.5/i18n/target/classes/openfire_i18n_ru_RU.properties
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ i18n ---
[INFO] No sources to compile

All those lines (or similar) are not in the 4.8.0 log.
The 4.8.0 archive is in my public distfiles directory. Can you try with that one?
Comment 5 Nikita Druba 2024-04-01 17:13:46 UTC
(In reply to Fernando Apesteguía from comment #4)

In my test environment openfire successfully builded with archive from you public distfiles directory. This archive really does not contain file, that builder want to find in you system: org.ow2.asm:asm:jar:5.0.2, org.ow2.asm:asm-commons:jar:5.0.2. But at my test jails - x64 and x86 FreeBSD 13.2, openjdk 11 or 17 builder does not download and does not want this version of packages.

Because maven from pkg want openjdk8, before "make" openfire, I do the next(for example to build with openjdk11):
pkg delete openjdk11 openjdk17 maven maven-wrapper
(I recommend for clean test remove all openjdk versions)
pkg install openjdk11
In this case maven building and linking to actual java version. I think the trouble in old or incorrect maven or maven-wrapper.
If you will see again the same error, please show "pkg version -v".
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2024-04-03 10:18:08 UTC
Created attachment 249676 [details]
Poudriere log for failing build
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2024-04-03 10:19:17 UTC
(In reply to Nikita Druba from comment #5)
Are you using poudriere?
I don't need to remove any packages manually, all the packages are either built or downloaded from the repo using poudriere, so the environment is clean.
Can you attach your poudriere log so we can compare them?
Comment 8 Nikita Druba 2024-04-08 20:07:26 UTC
(In reply to Fernando Apesteguía from comment #7)
No, I don't use poudriere yet. I saw you log. There maven is installing from pkg. This is trouble:
[14_0amd64-default] `-- Extracting openjdk8-8.402.06.1_1: .......... done
[14_0amd64-default] Extracting maven-3.8.8_1: .......... done
Cause current maven depend from openjdk8, but openfire need openjdk11 at least. I think, that maven must be linked to openjdk11 too. 
My maven linked to openjdk11 and don't search old deps for openjdk8.
I can add this deps to archive, but I'm sure, that it will cause other troubles later in the build process.
Comment 9 Fernando Apesteguía freebsd_committer freebsd_triage 2024-04-10 10:03:57 UTC
(In reply to Nikita Druba from comment #8)
Poudriere is the tool used by the builders to create packages so if poudriere doesn't build locally, it won't build it in the builders.

On the other hand, the "package seeding" feature just uses the same dependency version if it is in the repository as a package so you don't have to build it locally. I just disable the feature in poudriere to test if it has any effect on our case and it doesn't.

Am I understanding correctly, that you modified the maven build in the ports tree to use openjdk11 instead of openjdk8?
Comment 10 Nikita Druba 2024-04-22 20:41:26 UTC
(In reply to Fernando Apesteguía from comment #9)
No, I don't modified maven. Maven links with openjdk during build. I just builded maven and maven-wrapper as dependency during openfire build. If you have already installed openjdk, maven links with them. Otherwise maven use openjdk8. In pkg is version, builded with openjdk8. Openfire need minimal version openjdk11. Maven also must links with the same openjdk.
I checked now, if you try to build with maven from pkg and openjdk11 (or higher), you will take a fault "Invalid target release".
Comment 11 polarian 2024-05-14 23:05:45 UTC
(In reply to Fernando Apesteguía from comment #2)
I have posted this in upstream's XMPP channel, it was mentioned that on a clean system, after running `mvn dependency:go-offline` did not download all the dependencies and when `mvn package` is executed, more dependencies are pulled.

It will likely be difficult to build 4.8.x offline until the reason for this is found.
Comment 12 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-15 17:35:42 UTC
(In reply to polarian from comment #11)
Thanks for letting us know.
Comment 13 Nikita Druba 2024-05-16 23:23:39 UTC
(In reply to polarian from comment #11)
In this case, port has the "MAVEN_LOCAL" option. It downloads archive with all maven deps for this port for LTS versions openjdk(that openfire supports). I collect it the archive specially for every version.
Comment 14 Nikita Druba 2024-05-16 23:25:31 UTC
(In reply to Fernando Apesteguía from comment #12)
Do you have any ideas, what I can do for approving update commit?
Comment 15 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-17 08:29:14 UTC
(In reply to Nikita Druba from comment #14)
Hi Nikita,

Since the problem is reproducible, I think no committer will approve the update in its current shape.

The problem with this update is the following:

"If you have already installed openjdk, maven links with them. Otherwise maven use openjdk8. In pkg is version, builded with openjdk8. Openfire need minimal version openjdk11."

This should not happen. The build cluster uses poudriere to build ports. That means every port is built in a clean environment to ensure all the dependencies are properly handled.

We can add openjdk11 as BUILD_DEPENDS. I did it and then, *both* openjdk8 (dependency of maven) and openjdk11 (direct dependency of openfire) are installed before building. But then, the same error occurs.

=======================<phase: configure      >============================                                                                           [113/1954]
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0          
===>   openfire-4.8.0,1 depends on package: maven>0 - found                                                                                                     
===>   openfire-4.8.0,1 depends on file: /usr/local/openjdk8/bin/java - found
===>   openfire-4.8.0,1 depends on file: /usr/local/openjdk11/bin/java - found
===>   openfire-4.8.0,1 depends on file: /usr/local/bin/ccache - found
===>  Configuring for openfire-4.8.0,1                                          
===========================================================================                                                                                     
=======================<phase: build          >============================                                                                                     
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0         
===>  Building for openfire-4.8.0,1                                             
echo "cd /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.8.0 && mvn -DskipTests=true -o -Dmaven.repo.local=/wrkdirs/usr/ports/net-im/openfire/work/m2 package
"                                                                               
cd /wrkdirs/usr/ports/net-im/openfire/work/Openfire-4.8.0 && mvn -DskipTests=true -o -Dmaven.repo.local=/wrkdirs/usr/ports/net-im/openfire/work/m2 package
[INFO] Scanning for projects...                                                 
[WARNING]                                                                       
[WARNING] Some problems were encountered while building the effective model for org.igniterealtime.openfire:starter:jar:4.8.0
[WARNING] 'dependencies.dependency.systemPath' for install4j:install4j:jar should not point at files within the project directory, ${project.basedir}/libs/i4jru
ntime.jar will be unresolvable by dependent projects @ line 61, column 25
[WARNING]                                                                       
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Parent                                                             [pom]
[INFO] Internationalization files for Openfire                            [jar]
[INFO] Core XMPP Server                                                   [jar]
[INFO] Starter for Openfire                                               [jar]
[INFO] Openfire Plugins                                                   [pom]
[INFO] Openfire Plugin Assembly Descriptor                                [jar]
[INFO] Distribution                                                       [jar]
[INFO] 
[INFO] -----------------< org.igniterealtime.openfire:parent >-----------------
[INFO] Building Parent 4.8.0                                              [1/7]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-no-snapshots) @ parent ---
[INFO] 
[INFO] ------------------< org.igniterealtime.openfire:i18n >------------------
[INFO] Building Internationalization files for Openfire 4.8.0             [2/7]
[INFO]   from i18n/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-no-snapshots) @ i18n ---
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ i18n --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] 
[INFO] --- native2ascii-maven-plugin:2.0.1:inplace (utf8-to-latin1) @ i18n ---
[WARNING] The POM for org.ow2.asm:asm:jar:5.0.2 is missing, no dependency information available
[WARNING] The POM for org.ow2.asm:asm-commons:jar:5.0.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Parent 4.8.0: 
[INFO] 
[INFO] Parent ............................................. SUCCESS [  0.234 s]
[INFO] Internationalization files for Openfire ............ FAILURE [  0.421 s]
[INFO] Core XMPP Server ................................... SKIPPED
[INFO] Starter for Openfire ............................... SKIPPED
[INFO] Openfire Plugins ................................... SKIPPED
[INFO] Openfire Plugin Assembly Descriptor ................ SKIPPED
[INFO] Distribution ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.770 s
[INFO] Finished at: 2024-05-17T07:28:13Z 
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace (utf8-to-latin1) on project i18n: Execution utf8-to-latin1 of goal org.
codehaus.mojo:native2ascii-maven-plugin:2.0.1:inplace failed: Plugin org.codehaus.mojo:native2ascii-maven-plugin:2.0.1 or one of its dependencies could not be r
esolved: The following artifacts could not be resolved: org.ow2.asm:asm:jar:5.0.2, org.ow2.asm:asm-commons:jar:5.0.2: Cannot access igniterealtime (https://igni
terealtime.org/archiva/repository/maven/) in offline mode and the artifact org.ow2.asm:asm:jar:5.0.2 has not been downloaded from it before. -> [Help 1]

So openjdk8 is going to be always installed since it is a dependency of maven. The issue we could try to tackle is to instruct openfire to always use openjdk11 or higher if available and ignoring earlier versions. I assume this needs to be done in the maven build file for openfire.

Do you think you can have a look at that?
Comment 16 polarian 2024-05-17 14:56:44 UTC
(In reply to Fernando Apesteguía from comment #15)
Specifying the JDK you want to use is simple, Maven checks for `JAVA_HOME` environment variable, simply set this when you call mvn. Set this variable to the path to the correct JDK (in this case I assume `jdk11`).

As for the error you keep attaching, this is a missing dependencies error, it appears that maven is attempting to generate the localisations but can not find the dependencies required to do so, this is causing maven to fail.

However, as I referenced in my last comment, I believe this is likely something which needs to be fixed upstream. Could you explain how you are generating the dependency tarball, or link to documentation on it? I would like to take a look.

As a disclaimer I have only read the beginning of the porters guide, so I am unsure of any of the conventions or requirements.

The gist I am getting is that FreeBSD does not permit fetching of dependencies from 3rd party sources, and these must be within the port tree, correct?
Comment 17 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-17 17:05:01 UTC
(In reply to polarian from comment #16)
I'm not generating the "dependency tarball", Nikita is.

As for the other part, FreeBSD allows fetching sources from third party sources. That is what the ports tree is about, it is just an scaffolding for fetching sources in build them. 

The problem here is that once you have fetched all the sources and the corresponding dependencies, the builders do not allow any further net access. This is common practices to avoid certain types of chain supply attacks, for instance.

Any maintainer/developer should ensure that the port builds in poudriere. It is not enough to try in a semi-clean environment with semi-manual intervention.
Comment 18 polarian 2024-05-17 17:40:57 UTC
Nikita could you explain how you are generating the source tarball so I can better understand what is going on here.

Also, thank you Fernando for the explanation :)

From what I have read from the Makefile, FreeBSD has their own maven plugin for extracting the required dependencies from the local repository and tarballing it for the build process, however I am unsure where this is documented. I have searched the Porters handbook (more specifically https://docs.freebsd.org/en/books/porters-handbook/book/#using-java) to see if there is an explanation for this, but I can not find one, would you mind providing a link for it?

As a sidenote I reported the issue upstream, but until I can figure out how FreeBSD generates their maven local tarballs I am useless, see the upstream report here: https://igniterealtime.atlassian.net/browse/OF-2828

I apologise for the lack of information on the upstream report, I am going based off what I read here, and what one of the contributors to Openfire has told me, I can add more information later.
Comment 19 polarian 2024-05-17 17:51:19 UTC
Apologies for double posting, I just realised I misunderstood one of the previous posts.

Does FreeBSD use the tarballs for compiling the code, or is the tarball simply for debug purposes?

Nikita stated they personally generated the tarball, implying the build system didn't?

What I am trying to ask is, does the build system generate these tarballs or is this done manually?
Comment 20 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-17 17:59:54 UTC
Created attachment 250725 [details]
Fix build in clean environment

A bit dirty, but it works.
Due the the mandatory presence of both openjdk8 and openjdk8 use JAVA_HOME to force the latter and avoid the dependency downloading problem.
Comment 21 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-17 18:02:31 UTC
(In reply to polarian from comment #19)
It uses the sources from the upstream project. This could be a tarball or in other form. In the case of openfire, Nikita builds a tarball with all the necessary dependencies to avoid maven wanting to access the net at a forbidden stage during building.

The ports collection retrieves the sources from upstream using the MASTER_SITES variable, the USE_GITHUB related variables and others.

Check the Porter's Handbook, it is a great piece of documentation ;-)
Comment 22 polarian 2024-05-17 18:15:24 UTC
(In reply to Fernando Apesteguía from comment #21)
I have read the porter guide about the fetching of source code of Openfire, I have experience with packaging on Linux, so this is pretty straight forward.

However my question wasn't how the sources are being fetched, it is how the tarball is being created. If this is being done manually, how?

Considering you have got the port working now with ensuring Maven is using jdk11 I assume the dependency issue was related to maven using jdk8 (but the pom.xml tells the maven compiler that the source code is Java 11 so I am unsure why it didn't fail with an invalid jdk error...).

However the error was relating to dependencies, and thus it was logical to see how this tarball is being made, especially how another contributor stated they had a similar issue (which I am going to attempt to reproduce later).
Comment 23 Nikita Druba 2024-05-18 11:15:06 UTC
(In reply to polarian from comment #18)
Hi! 
Let's see to the build process of openfire with online maven deps. Maven downloads all needed deps to ~/.m2 directory. I do the next:
1. Build openfire with online deps with jdk11 in x64 jail.
2. Build openfire with online deps with jdk17 in x64 jail.
3. Build openfire with online deps with jdk11 in x86 jail.
4. Build openfire with online deps with jdk17 in x86 jail.
5. After combine .m2 folders to one and create from it tarball. 
No magic)
Comment 24 Nikita Druba 2024-05-18 11:18:37 UTC
(In reply to Fernando Apesteguía from comment #20)
Thank you, I understand direction. Today I will correct Makefile for additional openjdk17 support and clean all unnecessary. May be even try to build it in poudriere)
Comment 25 Nikita Druba 2024-05-18 12:29:13 UTC
(In reply to polarian from comment #16)
About deps build errors. Please, read my previous replies. This errors shows, cause deps-tarball dont have deps for jdk8. BUT! If I place there jdk8-deps, you will see another error, that mean, that openfire now support jdk11+. So, no reasons attach jdk8 deps to tarball.
Comment 26 polarian 2024-05-18 13:00:50 UTC
(In reply to Nikita Druba from comment #23)
This is not a good way to bundle dependencies, firstly you will catch in hundreds of dependencies which are likely not required, unless it is done in a clean environment.

Secondly, changing the JDK version would likely cause negligible difference, and even if it does, anything which is compiled with JDK11 will work with a JRE11+, so ensuring it can be compiled with and JDK11+ is redundant.

I saw the post to the igniterealtime Jira, I assume *-fetch stages are all net enabled, therefore possible to execute the dependency:go-offline goal? This would make the entire tarballing process redundant correct?
Comment 27 Nikita Druba 2024-05-18 13:27:31 UTC
(In reply to polarian from comment #26)
>This is not a good way to bundle dependencies, firstly you will catch in >hundreds of dependencies which are likely not required, unless it is done in a >clean environment.

Before collecting deps I remove ~/.m2 from my test jails. Its clean jails just for this task.

>Secondly, changing the JDK version would likely cause negligible difference, >and even if it does, anything which is compiled with JDK11 will work with a >JRE11+, so ensuring it can be compiled with and JDK11+ is redundant.

But some deps version differ. There are few of them, but they are there.

>I saw the post to the igniterealtime Jira, I assume *-fetch stages are all net >enabled, therefore possible to execute the dependency:go-offline goal? This >would make the entire tarballing process redundant correct?

If "mvn dependency:go-offline" will work correctly, then yes, deps-tarball will not need anymore.
Comment 28 Nikita Druba 2024-05-21 13:02:27 UTC
Created attachment 250857 [details]
git diff for net-im/openfire

Applied changes for poudriere correctly working.
Comment 29 polarian 2024-05-21 13:12:02 UTC
(In reply to Nikita Druba from comment #28)
I am curious about one thing.

Why complicate things by supporting multiple JDK versions to compile the code, when Java code is forward compatible. Openfire doesn't use any of the additional features which JDK17 provides so apart from possibly slightly more optimised bytecode, what is the benefit of it?

I assume JDK11 will be the version used to build the binary version in the pkg repository?

Also thanks for finding a working update to the port :)
Comment 30 Nikita Druba 2024-05-21 13:31:39 UTC
I reworked port. Now, for openjdk 11 and 17 versions, later 21 will been added. I check it by poudriere, it was successfully builded. I saw only in one mvn port JAVA_BUILD and JAVA_RUN, but in my environment port build without this settings.
Comment 31 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-21 13:32:06 UTC
Build testing...

Note to self: Add entry for CVE-2023-32315
Comment 32 polarian 2024-05-21 13:35:43 UTC
Also as a note, Openfire 4.8.1 has been released, and fixes quite a major bu in 4.8.0 which would cause clients to not connect properly.
Comment 33 Nikita Druba 2024-05-21 13:47:06 UTC
(In reply to polarian from comment #29)
Because I can and why not? It is actually not difficult. For example, someone might want to use on an Openfire server some other java software and might not want to have multiple jdk versions. Or "slightly more optimised bytecode". Or any other reason.

Yes, default openjdk version for openfire now - 11, it will been in public pkg binary repo.

Thanx, I will start porting 4.8.1 after successfully commiting 4.8.0.
Comment 34 polarian 2024-05-21 13:51:28 UTC
(In reply to Nikita Druba from comment #33)
Ah if its easy to do then amazing \o/

Thank you both Nikita and Fernando for the explanations, and for updating the port :)
Comment 35 commit-hook freebsd_committer freebsd_triage 2024-05-21 14:00:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c43f42aea2cad476f44eec3489b8706c28949813

commit c43f42aea2cad476f44eec3489b8706c28949813
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2024-05-21 13:57:49 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2024-05-21 13:57:49 +0000

    security/vuxml: openfire admin console bypass

    NVD assessment not yet provided.

    PR:             277054

 security/vuxml/vuln/2024.xml | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
Comment 36 commit-hook freebsd_committer freebsd_triage 2024-05-21 15:46:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5618a3ac4a1a72c27bc06062108df22dff6caa5

commit d5618a3ac4a1a72c27bc06062108df22dff6caa5
Author:     Nikita Druba <nikita@druba.su>
AuthorDate: 2024-05-21 13:26:52 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2024-05-21 15:45:58 +0000

    net-im/openfire: Update to 4.8.0

    ChangeLog:
    https://download.igniterealtime.org/openfire/docs/4.8.0/changelog.html

    PR:             277054
    Reported by:    nikita@druba.su (maintainer)
    Reviewed by:    polarian@polarian.dev
    MFH:            2024Q2 (security fixes)
    Security:       CVE-2023-32315

 net-im/openfire/Makefile  |  20 +++--
 net-im/openfire/distinfo  |  10 +--
 net-im/openfire/pkg-plist | 209 +++++++++++++++++++++++++++-------------------
 3 files changed, 141 insertions(+), 98 deletions(-)
Comment 37 Fernando Apesteguía freebsd_committer freebsd_triage 2024-05-21 15:48:47 UTC
Committed and merged to 2024Q2.

Thank you both for your work!
Comment 38 commit-hook freebsd_committer freebsd_triage 2024-05-21 15:48:54 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4dec35302fb3e686879951a9b27dbc9e9cfeec84

commit 4dec35302fb3e686879951a9b27dbc9e9cfeec84
Author:     Nikita Druba <nikita@druba.su>
AuthorDate: 2024-05-21 13:26:52 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2024-05-21 15:47:39 +0000

    net-im/openfire: Update to 4.8.0

    ChangeLog:
    https://download.igniterealtime.org/openfire/docs/4.8.0/changelog.html

    PR:             277054
    Reported by:    nikita@druba.su (maintainer)
    Reviewed by:    polarian@polarian.dev
    MFH:            2024Q2 (security fixes)
    Security:       CVE-2023-32315

    (cherry picked from commit d5618a3ac4a1a72c27bc06062108df22dff6caa5)

 net-im/openfire/Makefile  |  20 +++--
 net-im/openfire/distinfo  |  10 +--
 net-im/openfire/pkg-plist | 209 +++++++++++++++++++++++++++-------------------
 3 files changed, 141 insertions(+), 98 deletions(-)