Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Aug 2019 10:55:50 -0700
From:      Jason Helfman <jgh@helfman.org>
To:        "Daniel Morante" <daniel@morante.net>
Cc:        "freebsd-ports" <freebsd-ports@freebsd.org>
Subject:   Re: How to package maven based ports
Message-ID:  <16c6812adbe.10e020f64473134.778021451648232868@helfman.org>
In-Reply-To: <febedf4e-f52e-8560-ec8c-1d9a0059996c@morante.net>
References:  <9caa5ea5-e030-adab-516d-df957e07760f@fechner.net> <CAJuc1zMB9Ee-iyb8Gb0DeTJBuWrWC%2BvAEQyKgyS5gjDwLkpAsg@mail.gmail.com> <d26c73f1-b644-23e0-dba7-2172619cf1b4@fechner.net> <febedf4e-f52e-8560-ec8c-1d9a0059996c@morante.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I've looked over this thread a bit, and have done similar things in the pas=
t. I have created an archive of a maven repository after having remote repo=
s break the repeatable build process. I would create an archive, and then u=
se this archive as a distfile. I would then point to this archive during th=
e build phase to use as a repo.



I have also updated the using-java bits of the handbook awhile ago regardin=
g installing war files.



databases/jasperreports (a port I used to maintain was setup this way)



Over the years, I have suggested this methodology, which folks agreed with =
at the time, and have been in some ports since.=C2=A0


https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/using-ja=
va.html



Hope this helps

-jgh


---- On Sat, 20 Jul 2019 12:33:50 -0700 Daniel Morante via freebsd-ports <f=
reebsd-ports@freebsd.org> wrote ----


I've run into the same issue while attempting to port a few JAVA apps=20
that use maven and more recently one that also uses yarn for dependencies.

> Have a look at the java/eclipse port. It uses a pre-warmed maven
> repository that is fetched from github.
While this is indeed a clever solution, it's (in my opinion) not ideal.=C2=
=A0=20
Don't take this personally, I applaud you for taking the time and effort=20
in making the Eclipse port.=C2=A0 I use it on my systems.=C2=A0 However, I =
feel=20
that it's important that I point this out.=C2=A0 There are potential proble=
ms=20
with this approach.=C2=A0 Most notably that the source of the dependencies=
=20
gets changed from the original location.=C2=A0 The consequences could be=20
serious should something happen to your repository.

This in my opinion is a bigger issue caused by these so called 'modern'=20
package managers that are becoming popular to use (maven, npm, yarn, and=20
composer to name a few).=C2=A0 Historically like what is currently done wit=
h=20
perl and python (and to a lesser extent ruby), we would create ports for=20
each of these libraries and let the ports system handle the rest.

Ideally the FreeBSD ports system should have the needed tooling to fetch=20
these type of dependencies as part of the same process used during the=20
dist files retrieval step.=C2=A0 One method would be for the porter to=20
include the pom.xml, composer.json, and/or package.json files as part of=20
the port skeleton.=C2=A0 The ports system would (using appropriate tools)=
=20
download the dependencies to 'pre-warm' a local cache as you are doing.=C2=
=A0=20
Then set the environment to use the local cache instead of downloading=20
during the build phase.

I think this may be possible to hack together using the current make=20
targets 'pre-fetch' and 'post-fetch'?=C2=A0 Further thinking about this,=20
having the pom.xml in the skeleton may not even be needed is you can use=20
the post-fetch target?

On 7/14/2019 3:21 PM, Matthias Fechner wrote:
> Am 14.07.2019 um 00:23 schrieb Jonathan Chen:
>> Have a look at the java/eclipse port. It uses a pre-warmed maven
>> repository that is fetched from github.
>>
>> You can create a localised repository that only contains the
>> dependancies required by the project by specifying:
>>    -D maven.repo.local=3D/my/local/repo
>>
>> Once your project builds correctly, you can create a repo as a project
>> on Github with its contents that can be retrieved with the port for
>> the build.
> thanks a lot for this.
> I'm not fully done with the port, but I was able to get this maven
> repository to be pushed to github and the port downloads it and
> compilation works as expected.
> Thanks a lot for you answer, it helped a lot.
>
> Now I need someone for testing the port, as I do not use it and are
> therefor I'm not able to test it.
>
> The final step would be to do some clean up a make the port more pretty.
>
> I try later to write a short summary if some one else needs to build a
> port with maven how it could be done.
>
> Gru=C3=9F
> Matthias
>
_______________________________________________
mailto:freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "mailto:freebsd-ports-unsubscribe@freebsd.=
org"
From owner-freebsd-ports@freebsd.org  Tue Aug  6 21:05:56 2019
Return-Path: <owner-freebsd-ports@freebsd.org>
Delivered-To: freebsd-ports@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2471ECA5FE
 for <freebsd-ports@mailman.nyi.freebsd.org>;
 Tue,  6 Aug 2019 21:05:56 +0000 (UTC)
 (envelope-from karlo@klarinet.osamsb.hr)
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com
 [64.147.123.19])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4636cL4fcTz4VTr
 for <freebsd-ports@freebsd.org>; Tue,  6 Aug 2019 21:05:53 +0000 (UTC)
 (envelope-from karlo@klarinet.osamsb.hr)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id D697F500
 for <freebsd-ports@freebsd.org>; Tue,  6 Aug 2019 17:05:51 -0400 (EDT)
Received: from imap1 ([10.202.2.51])
 by compute5.internal (MEProxy); Tue, 06 Aug 2019 17:05:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm3; bh=5xjp9P8Ixcl+mLmlkS49Z4RsgL+FP
 J5D8ZD2JZulLao=; b=svSfbSYatJvb6/4AdunfPiHrVS72YieYyQlidyDxpEHtZ
 idXcF+W+DwlKazxqhkFhdgRT6r1DzfKL9rqdhWD5GFUJo0H6paevYIYWZg9BGsDU
 OMLipVb8+xTXBKYhbelsqWnzhuQonWAPPIcUVN5ApOT7uB3ki/yq32oQoSIkyEkn
 X49xBXmem7GQ/Y0S4J3l5qHnrTRIm0PwuqzcdIxDiuwwWu6NrSDo0jrtOeTyATCI
 69JQBkj+159pRWjOcRd/wgg4FepE7q9bgMEP7jvhCySLN+Z0YLcxh5aUeAzlPjeB
 MTPsXyZNLVipBcpm/2nyYiZ28qR/nE5dBbKAeYIlg==
X-ME-Sender: <xms:rutJXcIsOnWWGt9Yh8IKzlmJCGGTveg6OPbEBI1l3Z-4OTaXBn7ZZw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddutddgudehiecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtre
 dtreertdenucfhrhhomhepfdfmrhgrlhhjucfmrghrlhhofdcuoehkrghrlhhosehklhgr
 rhhinhgvthdrohhsrghmshgsrdhhrheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorh
 hgnecurfgrrhgrmhepmhgrihhlfhhrohhmpehkrghrlhhosehklhgrrhhinhgvthdrohhs
 rghmshgsrdhhrhenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:rutJXUVvDImk7CHyxPXv8Np5M2WnUzQSJx1WLl6OAWJ7kLZLj9KuGA>
 <xmx:rutJXUwKhNLzzWOfXbD8wR15rEBhkFCnX36S-HIL12S9ca0cce3U2g>
 <xmx:rutJXfgQWa5vOaqmv6rrhAVZORLBY1Ets_RzNrElY5nNEsvqXU5PYA>
 <xmx:r-tJXeFQMsmeovUySAGBxiZZBs0CG-wVjjRNdfS4mejvc4GXJklwSg>
Received: by mailuser.nyi.internal (Postfix, from userid 501)
 id 97756C200A4; Tue,  6 Aug 2019 17:05:50 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.6-808-g930a1a1-fmstable-20190805v2
Mime-Version: 1.0
x-forwarded-message-id: <20190804043538.B454C380075@mailuser.nyi.internal>
Message-Id: <8dd1d689-a065-4931-b9d3-8727aac2d892@www.fastmail.com>
Date: Tue, 06 Aug 2019 17:05:49 -0400
From: "Kralj Karlo" <karlo@klarinet.osamsb.hr>
To: freebsd-ports@freebsd.org
Subject: Creation of a diff of a new port
Content-Type: text/plain
X-Rspamd-Queue-Id: 4636cL4fcTz4VTr
X-Spamd-Bar: -----
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=messagingengine.com header.s=fm3 header.b=svSfbSYa;
 dmarc=none;
 spf=none (mx1.freebsd.org: domain of karlo@klarinet.osamsb.hr has no SPF
 policy when checking 64.147.123.19) smtp.mailfrom=karlo@klarinet.osamsb.hr
X-Spamd-Result: default: False [-5.88 / 15.00]; ARC_NA(0.00)[];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm3];
 XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[];
 TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[];
 MIME_GOOD(-0.10)[text/plain];
 PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org];
 TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1];
 NEURAL_HAM_LONG(-1.00)[-0.998,0]; RCVD_COUNT_THREE(0.00)[4];
 DMARC_NA(0.00)[osamsb.hr];
 DKIM_TRACE(0.00)[messagingengine.com:+];
 NEURAL_HAM_SHORT(-0.99)[-0.994,0];
 IP_SCORE(-3.50)[ip: (-9.90), ipnet: 64.147.123.0/24(-4.88), asn: 11403(-2.68),
 country: US(-0.05)]; R_SPF_NA(0.00)[];
 RCVD_IN_DNSWL_LOW(-0.10)[19.123.147.64.list.dnswl.org : 127.0.5.1];
 FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+];
 ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US];
 RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[]
X-BeenThere: freebsd-ports@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Porting software to FreeBSD <freebsd-ports.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-ports>,
 <mailto:freebsd-ports-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-ports/>;
List-Post: <mailto:freebsd-ports@freebsd.org>
List-Help: <mailto:freebsd-ports-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-ports>,
 <mailto:freebsd-ports-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Aug 2019 21:05:56 -0000

I am trying to create a diff of a new port in order that I may submit the port.
I believe to have followed the directions from the Porter's Handbook, but
the result is not as I had expected.

  $ portsnap fetch
       (I didn't save the output.)
  $ portsnap extract
       (I didn't save the output.)
  $ svn checkout https://svn.FreeBSD.org/ports/head /usr/ports
   ... (lots of output omitted)
     A /usr/ports/Keywords/shell.ucl
     A /usr/ports/Keywords/fc.ucl
     A /usr/ports/Keywords/desktop-file-utils.ucl
   U   /usr/ports
  Checked out revision 508034.
  $ cp -r my-keynav-port /usr/ports/x11/keynav
  $ svn add /usr/ports/x11/keynav/
  svn: E155013: Can't add '/usr/ports/x11/keynav' to a parent directory scheduled for deletion
  $ uname -a
  FreeBSD t5600 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64

Also, I have tried running "svn diff" on ports that I did not change.
I expected no output in such cases and was surprised to see output.

  $ svn diff | head
  Index: Makefile
  ===================================================================
  --- Makefile    (revision 508034)
  +++ Makefile    (nonexistent)
  @@ -1,102 +0,0 @@
  -# Created by: Scott Blachowicz <scott+ports@sabami.seaslug.org>
  -# $FreeBSD$
  -
  -PORTNAME=      nmh
  -PORTVERSION=   1.7.1

What must I do in order add the new directory?

I pray that you have faith in my best sentiments.
Kralj Karlo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16c6812adbe.10e020f64473134.778021451648232868>