p2 repository with log4j2x - eclipse-plugin

Earlier eclipse rcp workspace is referring to the target having log4j1.2.15 version. Below are the reference links.
eclipse latest p2 repository:(does not have the log4j)
ref1:https://download.eclipse.org/eclipse/updates/4.17-I-builds/I20200817-0920/plugins/
p2 repo with log4j 12.15 version
ref2:
https://download.eclipse.org/oomph/archive/reports/download.eclipse.org/releases/2020-06/http___download.eclipse.org_releases_2020-06_202006171000/org.apache.log4j_1.2.15.v201012070815.html
From which p2 repository , we can find the log4j2 version jars (log4j2xapi, log4j2xcore).
Or is there any way to build jars and update corporate p2 repo instead of eclipse p2 repo

You use an integration (a kind of nightly build) repository for the future release, which will be deleted one day. If you don't want to test upfront whether your application will work with the future Eclipse release, better use a release repository instead.
Anyway, use the Eclipse project (the Eclipse platform and JDT) repository and if something is missing, check out the more comprehensive simultaneous release repository. If it is missing there as well, see if you can find it in Eclipse Orbit:
Eclipse Project: https://download.eclipse.org/eclipse/updates/<eclipse-platform-version>/ (currently, the Eclipse platform version of the current release is 4.16 and of the upcoming release is 4.17)
Simultaneous Release: https://download.eclipse.org/releases/<release-name>/ (currently, the current release is 2020-06 and the upcoming release is 2020-09) - in your case, also the repository for the upcoming release currently contains log4j
Eclipse Orbit

Related

How to add facets to an IntelliJ Java/Gradle project to create a self-sufficient war

Background
Download and install IntelliJ 12.04 Community Edition
Create project from external source (point to Gradle build script)
Specify JDK 7 as project's SDK
Note: Project is open source at github: Netflix/karyon
Problem
Want to simply war the project. In playing on the commercial version with GAE plugin installed, I was able to specify the Web Application facet, and create the war via the artifact functionality. With the setup described above, the only available facet is Android.
Question
How can I create a self sufficient war (includes all dependencies and hence can be dropped in any container without additional classpath requirements) from within the IDE?
IntelliJ IDEA Community edition doesn't have Java EE support, you need to use some other tool for packaging the war (e.g. Maven).

Maven snapshot "lifecycle"

Here is my current understand of how Maven handles dependencies.
When a dependency is being actively worked on Maven attaches the "-SNAPSHOT" to the end of the version. ex) 1.1.1-SNAPSHOT. These snapshots are uploaded to a remote repository that is specifically responsible for snapshots. The same remote repository has a section for released versions of the packages. Now when a project has the dependencies updated, Maven pulls the most recent version of a package into the local repository. ONLY SNAPSHOTS are updated depending on the time stamp on the the snapshot. If Maven pulls down a release version (ex: 1.1.0) it will never look for another package with the current version.
Now my questions are:
What are the flaws in my understanding? Am I missing a conceptual piece?
When a package moves from a SNAPSHOT to a release version, how do the pom.xml get updated to reflect the released version of the package? Is this a manual process?
Lastly, if a package is released, we'll use the example from above, 1.1.1 is released. Is 1.1.2-SNAPSHOT created or 1.2.0-SNAPSHOT created, and is this the version that will be updated in the poms?
Snapshots are currently in development versions and could be not stable.
We are old fashioned company which still use svn:
The development is going in the trunk and version in pom files are snapshots (we have dependencies to some opensource libraries that have fixed version, and we update them as soon as new release happens and we are confident about switching)
As soon as we are going to release we are branching trunk and changing versions in pom to corresponded fixed one (some companies could mark them with suffix -rc)
Release (Companies that use -rc will change version in pom to fixed one)
Please take a look to release maven plugin to skip manual version changes.
I hope this answers some of your questions.
About the versioning answer - it depends. Please read about it more here:
http://en.wikipedia.org/wiki/Software_versioning
Best Practice: Software Versioning

Release Management - Maven, Bamboo and JIRA

I'd like to find the best way to manage releases using Maven 2, Bamboo 3.1 and JIRA 4.3. I've tried many things but I keep hitting dead ends due to bugs or missing functionality.
My end goal is to have versions come from JIRA, have Bamboo take those versions and build artefacts from them using Maven then deploy those artefacts to a repository (Nexus in our case).
Here are the approaches I have tried:
1) Use a place holder in all poms for project versions:
Parent pom
<project ...>
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>${ci.version}</version>
...
<modules>...</modules>
</project>
Child pom
<project ...>
<parent>
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>${ci.version}</version>
</parent>
<artifactId>child</artifactId>
...
</project>
This builds if you start the build from the project root pom and specify -Dci.version=<my-version> on the command line. Combine this with the Bamboo Release Management Plugin and I can build and deploy versions of my modules and release as needed.
The problem with this approach is that Maven does not replace place holder variables in poms when deploying or installing which means the poms in the repository have the ${ci.version} marker when I'd really like them to have the concrete version. Because of the place holder it means nobody can use the modules I deploy. See MNG-2971.
2) Use concrete SNAPSHOT versions in the pom and configure bamboo to execute the Maven Release Plugin using the Bamboo Release Management Plugin.
Unfortunately the Maven Release Plugin needs the version to increment to, the bamboo plugin allow you to get the name of the current version to build but not the next one. Without this information using the Maven Release Plugin would increment the version to something that is not managed by JIRA. To make this option work I'd either need the next version available to me or be able to run a plan after the Bamboo Release Management Plugin has done it's thing (this second fix would also add extra mess to the commit logs as you'd get one commit for the auto increment and one for the proper increment).
2.b) Same as 2) but you have to specify the next version in Bamboo before any release build through the plan configuration interface, setting the value manually to the next JIRA version the plan should be working on. This fixes the problem with 2) but adds extra manual steps.
3) Do things manually, probably using the Maven Release Plugin. Completely ignore all release functionality in Bamboo and manually manage released on the command line by calling the Maven Release Plugin goal to change the version as and when needed. JIRA versions will also need to be released manually when this happens. We also need to configure a bamboo build to run and test the tag that the release plugin creates for the non-SNAPSHOT version.
This option has so much process involved something is bound to go wrong.
I can't be the only person trying to get automated releases using these technologies, can anyone help.
Thanks
matt,
You have to specify in your goal -Dci.version={bamboo.custom.brmp.name}
I stumbled upon your question when I was looking for exact the same information, but then for JIRA 4.4 and Bamboo 3.3, where the release management plugin has been replaced / upgraded with the JIRA Bamboo plugin ...
Hope this helps,
Francis

How to remove/update maven project

New to Maven.
Ok so I used Maven to package up my project, but one of the files had some test information in it. I would like to change that file but I'm at a standstill as keeping the same version number of the project.
I don't know what to do! Are these my options and what's the best way to do this?
Change the file and do a new build of the project which would increment the build by one.
Example: Build is at 2.0, it would move to 2.0.1 or 2.1
Remove the project from Maven and do a rebuild of the last project but with the new changes.
This is what I want to do but don't know how to remove the project from Maven and reset everything to do a rebuild
Open to suggestions???
Thanks
What exactly do you mean by "remove a project from Maven"? You mean from a public Maven repository?
You should probably bump up the version, as most projects do, when there's an "oops" moment like that. The release notes would ideally state why there's been a new version. Ideally a public notice as well.
Otherwise, you risk people getting the wrong version, or something that they have the fixed version, or whatever. For example, I use the Maven offline option (i.e., -o) pretty regularly so I don't grab the latest snapshots.
I used Maven to package up my project, but one of the files had some test information in it. I would like to change that file but I'm at a standstill as keeping the same version number of the project.
Maven never re-downloads released artifacts with a fixed version (as opposed to a SNAPSHOT version) once they have been downloaded (unless you delete an artifact from your local repository of course but you obviously can't rely on that). This is the only way to guarantee reproducibility (if I rebuild later, I get the same behavior). And in the same spirit, you actually can't re-release an artifact with a fixed version. This is the only way to guarantee consistency (everybody gets the same stuff).
So you'll have to change the version if you want to re-release your project.
Note that if your project is under active development, you should use a SNAPSHOT version. Here is what the Maven: Definitive guide writes about them:
3.3.1.2. SNAPSHOT Versions
Maven versions can contain a string
literal to signify that a project is
currently under active development. If
a version contains the string
“SNAPSHOT,” then Maven will expand
this token to a date and time value
converted to UTC (Coordinated
Universal Time) when you install or
release this component. For example,
if your project has a version of
“1.0-SNAPSHOT” and you deploy this
project’s artifacts to a Maven
repository, Maven would expand this
version to “1.0-20080207-230803-1” if
you were to deploy a release at 11:08
PM on February 7th, 2008 UTC. In other
words, when you deploy a snapshot, you
are not making a release of a software
component; you are releasing a
snapshot of a component at a specific
time.
Why would you use this? SNAPSHOT
versions are used for projects under
active development. If your project
depends on a software component that
is under active development, you can
depend on a SNAPSHOT release, and
Maven will periodically attempt to
download the latest snapshot from a
repository when you run a build.
Similarly, if the next release of your
system is going to have a version
"1.4", your project would have a
version "1.4-SNAPSHOT" until it was
formally released.
As a default setting, Maven will not
check for SNAPSHOT releases on remote
repositories. To depend on SNAPSHOT
releases, users must explicitly enable
the ability to download snapshots
using a repository or pluginRepository
element in the POM.
When releasing a project, you should
resolve all dependencies on SNAPSHOT
versions to dependencies on released
versions. If a project depends on a
SNAPSHOT, it is not stable as the
dependencies may change over time.
Artifacts published to non-snapshot
Maven repositories such as
http://repo1.maven.org/maven2 cannot
depend on SNAPSHOT versions, as
Maven's Super POM has snapshot's
disabled from the Central repository.
SNAPSHOT versions are for development
only.

Replacing -SNAPSHOT in pom when releasing

I am developing code actively, with my developing team. When we release to our customers, I would like to provide jars without the -SNAPSHOT so they only need to update when a new dot version is created.
This there a maven plugin that provides this functionality. I know there is because everyone else must do it some how. I doubt it is manually.
I would appreciate answers to be explicit as possible.
Please and thank you.
Some plugins can help here, as already mentioned in this answer and in the comments of this one: the Maven Release Plugin if you want to fully automate the release and/or the Maven Versions Plugin.
With the Maven Release Plugin
Releasing a project with the Maven Release Plugin is done in two steps: prepare and perform and here is what the documentation writes about the release:prepare goal:
Preparing a release goes through the
following release phases:
Check that there are no uncommitted changes in the sources
Check that there are no SNAPSHOT dependencies
Change the version in the POMs from x-SNAPSHOT to a new version (you
will be prompted for the versions to
use)
Transform the SCM information in the POM to include the final
destination of the tag
Run the project tests against the modified POMs to confirm everything is
in working order
Commit the modified POMs
Tag the code in the SCM with a version name (this will be prompted
for)
Bump the version in the POMs to a new value y-SNAPSHOT (these values
will also be prompted for)
Commit the modified POMs
In other words, the Maven Release Plugin is exactly doing what you're asking for.
With the Maven Versions Plugin
If you don't use the Maven Release Plugin, the Maven Versions Plugin can be helpful. In particular, the following goals:
versions:update-parent updates the parent section of a
project so that it references the
newest available version. For example,
if you use a corporate root POM, this
goal can be helpful if you need to
ensure you are using the latest
version of the corporate root POM.
versions:update-child-modules
updates the parent section of the child modules of a project so the
version matches the version of the
current project. For example, if you
have an aggregator pom that is also
the parent for the projects that it
aggregates and the children and parent
versions get out of sync, this mojo
can help fix the versions of the child
modules. (Note you may need to invoke
Maven with the -N option in order to
run this goal if your project is
broken so badly that it cannot build
because of the version mis-match).
versions:set can be used to set the project version from the
command line.
versions:commit removes the pom.xml.versionsBackup files. Forms
one half of the built-in "Poor Man's
SCM".
versions:revert restores the pom.xml files from the
pom.xml.versionsBackup files. Forms
one half of the built-in "Poor Man's
SCM".
I mentioned several goals but the "most" interesting is probably versions:update-child-modules here. It would allow to change the version in the top parent pom and then to automate the update of the child. See Fixing a multi-module build for an example.
Can't help more, you need to experiment yourself now. Good luck!
References
The Maven Release Plugin
The Maven Versions Plugin