How to interpolate a value in a Maven plugin

2018-12-26 Thread Jochen Wiedmann
Hi,

I have written a Maven plugin, which must interpret values like
${project.artifactId}, and the like.
My first attempt was to use
project.getProperties().get("project.artifactId"), but that seems
to work only for the values, which are configured in the POM's
property section. So, what would be a better approach?

Thanks,

Jochen

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: How to interpolate a value in a Maven plugin

2018-12-26 Thread Karl Heinz Marbaise

Hi Jochen,

On 26/12/18 22:36, Jochen Wiedmann wrote:

Hi,

I have written a Maven plugin, which must interpret values like
${project.artifactId}, and the like.


Where exactly do you use them ? Are injected as parameters ?

My first attempt was to use
project.getProperties().get("project.artifactId"), but that seems
to work only for the values, which are configured in the POM's
property section. So, what would be a better approach?


Can you give a full example for that ? Or a link to the project?

Kind regards
Karl Heinz Marbaise

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: How to interpolate a value in a Maven plugin

2018-12-26 Thread Jochen Wiedmann
On Wed, Dec 26, 2018 at 10:54 PM Karl Heinz Marbaise  wrote:

> > I have written a Maven plugin, which must interpret values like
> > ${project.artifactId}, and the like.
>
> Where exactly do you use them ? Are injected as parameters ?

No, they are basically snippets, which have been extracted from
external files. Hard to describe. Please assume, that I can't use the
standard filtering, because I've got to operate on strings, not files.
(Think of values in a hash map.)

> Can you give a full example for that ? Or a link to the project?

Sorry, not open source, thus not available.

Thanks,

Jochen

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: How to interpolate a value in a Maven plugin

2018-12-26 Thread Karl Heinz Marbaise

Hi Jochen,
On 26/12/18 23:27, Jochen Wiedmann wrote:

On Wed, Dec 26, 2018 at 10:54 PM Karl Heinz Marbaise  wrote:


I have written a Maven plugin, which must interpret values like
${project.artifactId}, and the like.


Where exactly do you use them ? Are injected as parameters ?


No, they are basically snippets, which have been extracted from
external files. Hard to describe. Please assume, that I can't use the
standard filtering, because I've got to operate on strings, not files.
(Think of values in a hash map.)


I would suggest to take a look at a more higher level:

http://maven.apache.org/shared/maven-filtering/

If you need more low level than take a look here:

https://codehaus-plexus.github.io/plexus-interpolation/
https://github.com/codehaus-plexus/plexus-interpolation

Kind regards
Karl Heinz Marbaise



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven builds stalling on Bitbucket

2018-12-26 Thread Sander Verhagen
Hi all,


I'm sorry for reposting this[1]. But I'm sure there is someone in this 
community who could inspire me to fix this. We are still seeing a lot of 
stalled Maven builds on Bitbucket, and we don't know anymore what to do about 
it, besides moving off of Bitbucket (which we've talked about... red tape). 
Your help would be much appreciated!!!

Best regards, Sander.

[1] 
https://mail-archives.apache.org/mod_mbox/maven-users/201812.mbox/%3C8ccd358932e3475a91243cb785a15ce5%40MBX14D-ORD1.mex06.mlsrvr.com%3E


Sander Verhagen
[  san...@sanderverhagen.net  ]

On 11/12/2018 13:19, Sander Verhagen wrote:

Hi all,


Need some help! My current gig is running its Maven builds on Bitbucket. On a 
regular basis, builds stall while downloading dependencies (I'd say 5%~10% of 
all builds). It looks a lot like [1]. The proposed solution 
(maven.wagon.http.pool=false) does not show any noticeable improvement. 
Atlassian declined to investigate, even though this only ever happens on 
Bitbucket (local builds have never been seen having this problem).

I have included some logging (-X) from just before the stall. The stalls can 
happen anywhere dependencies are downloaded, so seemingly unrelated to this 
particular goal.

I would love to get some suggestions on how to fix this, or at least on how to 
troubleshoot it further.

Thank you!

[1] 
https://bitbucket.org/site/master/issues/13988/pipelines-kills-idle-maven-connections


Sander Verhagen
[  
san...@sanderverhagen.net
  ]



[DEBUG] ---
[DEBUG] Goal: com.github.warmuuh:pactbroker-maven-plugin:0.0.13:upload-pacts 
(upload-pacts)
[DEBUG] Style: Regular
[DEBUG] Configuration: 

<... snip ...>

[DEBUG] ===
[DEBUG] Could not find metadata commons-io:commons-io/maven-metadata.xml in 
local (/root/.m2/repository)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://some_repo_release/nexus/content/repositories/some_repo_release/
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://jitpack.io
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://repo.spring.io/libs-snapshot
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://jitpack.io
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/
[INFO] Downloading from some_repo_snapshot: 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/commons-io/commons-io/maven-metadata.xml
[INFO] Downloading from jitpack.io: 
https://jitpack.io/commons-io/commons-io/maven-metadata.xml
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://repo.spring.io/libs-snapshot
[INFO] Downloading from spring-snapshots: 
http://repo.spring.io/libs-snapshot/commons-io/commons-io/maven-metadata.xml
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://some_repo_release/nexus/content/repositories/some_repo_release/
[INFO] Downloading from some_repo_release: 
http://some_repo_release/nexus/content/repositories/some_repo_release/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://oss.sonatype.org/content/repositories/snapshots
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://oss.sonatype.org/content/repositories/snapshots
[INFO] Downloading from sonatype-nexus-snapshots: 
https://oss.sonatype.org/content/repositories/snapshots/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://clojars.org/repo
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://clojars.org/repo
[INFO] Downloading from clojars: 
http://clojars.org/repo/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://repo.maven.apache.org/maven2
[INFO] Downloading from central: 
https://repo.maven.apache.org/maven2/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Writing tracking file 
/root/.m2/reposito

Re: Maven builds stalling on Bitbucket

2018-12-26 Thread Michael Osipov
I have fixed this already in Wagon 3.2.0 in WAGON-486. Use a Maven 
version which has this builtin. It should fix your NAT problem.

Reread the tickets, my explanations were very detailed.

Michael

Am 2018-12-27 um 00:20 schrieb Sander Verhagen:

Hi all,


I'm sorry for reposting this[1]. But I'm sure there is someone in this 
community who could inspire me to fix this. We are still seeing a lot of 
stalled Maven builds on Bitbucket, and we don't know anymore what to do about 
it, besides moving off of Bitbucket (which we've talked about... red tape). 
Your help would be much appreciated!!!

Best regards, Sander.

[1] 
https://mail-archives.apache.org/mod_mbox/maven-users/201812.mbox/%3C8ccd358932e3475a91243cb785a15ce5%40MBX14D-ORD1.mex06.mlsrvr.com%3E


Sander Verhagen
[  san...@sanderverhagen.net  ]

On 11/12/2018 13:19, Sander Verhagen wrote:

Hi all,


Need some help! My current gig is running its Maven builds on Bitbucket. On a 
regular basis, builds stall while downloading dependencies (I'd say 5%~10% of 
all builds). It looks a lot like [1]. The proposed solution 
(maven.wagon.http.pool=false) does not show any noticeable improvement. 
Atlassian declined to investigate, even though this only ever happens on 
Bitbucket (local builds have never been seen having this problem).

I have included some logging (-X) from just before the stall. The stalls can 
happen anywhere dependencies are downloaded, so seemingly unrelated to this 
particular goal.

I would love to get some suggestions on how to fix this, or at least on how to 
troubleshoot it further.

Thank you!

[1] 
https://bitbucket.org/site/master/issues/13988/pipelines-kills-idle-maven-connections


Sander Verhagen
[  
san...@sanderverhagen.net
  ]



[DEBUG] ---
[DEBUG] Goal: com.github.warmuuh:pactbroker-maven-plugin:0.0.13:upload-pacts 
(upload-pacts)
[DEBUG] Style: Regular
[DEBUG] Configuration: 

<... snip ...>

[DEBUG] ===
[DEBUG] Could not find metadata commons-io:commons-io/maven-metadata.xml in 
local (/root/.m2/repository)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://some_repo_release/nexus/content/repositories/some_repo_release/
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://jitpack.io
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://repo.spring.io/libs-snapshot
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://jitpack.io
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/
[INFO] Downloading from some_repo_snapshot: 
http://some_repo_snapshot/nexus/content/repositories/some_repo_snapshot/commons-io/commons-io/maven-metadata.xml
[INFO] Downloading from jitpack.io: 
https://jitpack.io/commons-io/commons-io/maven-metadata.xml
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://repo.spring.io/libs-snapshot
[INFO] Downloading from spring-snapshots: 
http://repo.spring.io/libs-snapshot/commons-io/commons-io/maven-metadata.xml
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://some_repo_release/nexus/content/repositories/some_repo_release/
[INFO] Downloading from some_repo_release: 
http://some_repo_release/nexus/content/repositories/some_repo_release/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://oss.sonatype.org/content/repositories/snapshots
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://oss.sonatype.org/content/repositories/snapshots
[INFO] Downloading from sonatype-nexus-snapshots: 
https://oss.sonatype.org/content/repositories/snapshots/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
http://clojars.org/repo
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
http://clojars.org/repo
[INFO] Downloading from clojars: 
http://clojars.org/repo/commons-io/commons-io/maven-metadata.xml
[DEBUG] Writing tracking file 
/root/.m2/repository/commons-io/commons-io/resolver-status.properties
[DEBUG] Using transporter WagonTransporter with priority -1.0 for 
https://repo.maven.apache.org/maven2
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
https://repo.maven.apache.org/maven2
[INFO] Downloa