We have process definition deployed in production and lots of process instances are initialized and in flight.
Now there are changes required to be done in process definition (.bpmn file) to accommodate other business scenarios.
We understand that we can not just replace the old .bpmn file with new one because old .bpmn file may be referred by in flight processes.
What is easiest and best way to handle this situation?
Note: We are using JBPM 6.0
To create a new version:
Make your edits to the process definition and anything else in the project.
Make sure the project and process definition is saved.
In the Project editor->Project General Settings change the version number.
Save, build and deploy.
A new version is deployed. The deployment id will have the new version number:
GenusOU:MCTestWF1:2.0
In the repository there will be a separate version directory for each version in the project.
The project's maven-metadata.xml will contain all versions:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>GenusOU</groupId>
<artifactId>MCTestWF1</artifactId>
<versioning>
<release>3.0</release>
<versions>
<version>1.0</version>
<version>2.0</version>
<version>3.0</version>
</versions>
<lastUpdated>20160825183701</lastUpdated>
</versioning>
</metadata>
Related
I'm using maven to fetch dependencies from our company's internal repositories. We use Artifactory. Everything works ok, but sometimes I have a recurring problem. After mvn -U clean compile I get an error.
Could not resolve dependencies for project company_groupId:company_dependency-articfactId:jar:0.0.1-SNAPSHOT: Could not find artifact company_groupId:company_dependency-articfactId:jar:2.0.17-20210429.123648-56 in snapshots2 (https://company.repository/snapshots)
When I look which jars repository actually contains, it appears it has 3 files in company_dependency-articfactId/0.0.1-SNAPSHOT
maven-metadata.xml
company_dependency-articfactId-2.0.17-20210430.091957-56.jar
company_dependency-articfactId-2.0.17-20210430.091957-56.pom
So, maven searches for date 20210429 and what repository actually contains is date 20210430 .
I thought maybe something removes dependencies, but the I looked inside maven-metadata.xml .
Comments added for better understanding.
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1.0">
<groupId>company_dependencyId</groupId>
<artifactId>company_dependency-articfactId</artifactId>
<version>2.0.17-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20210430.091957</timestamp> <!-- ok version -->
<buildNumber>56</buildNumber>
</snapshot>
<lastUpdated>20210430092512</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>2.0.17-20210429.123648-56</value> <!-- WRONG version -->
<updated>20210429123648</updated>
</snapshotVersion>
<snapshotVersion>
<extension>pom</extension>
<value>2.0.17-20210430.091957-56</value> <!-- ok version -->
<updated>20210430091957</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
As you can see, jar version of snapshot actually points to the wrong jar, which doesn't exist.
I looked at other dependencies and they're ok. So it's not something, which happens to all artifacts at a specific date.
I've no idea what could have caused this. Maybe somebody has already encountered such an issue?
Also I have couple of specific questions.
Could this mismatch between pom and jar versions of snapshots occur naturally? Like a script, which uploads next version for pom, but not for jar?
Could it be some kind of an error, when we have already uploaded pom, but couldn't upload jar for some reason? I mean it probably could happen, but is it reasonable to think that actually happens regularly?
Maybe it's a normal thing to upload pom and jar separately?
I haven't experienced anything like that before, so any help is much appreciated.
There's a couple of bugs in Artifactory, which could have caused this. For example https://www.jfrog.com/jira/browse/RTFACT-21321 https://www.jfrog.com/jira/browse/RTFACT-6514 or https://www.jfrog.com/jira/browse/RTFACT-21321 .
The problem could be solved by recreating metadata as J Fabian Meier suggested.
Got same problem. After some research it seams to be a known & already fixed bug https://issues.apache.org/jira/browse/MNG-6754.
Upgrading your maven should fix it.
I have tried to resolve the problem by this questions: Netbeans 11.2: No suitable Deployment Server is defined for the project or globally, but my nb-configuration.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.8-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<netbeans.hint.jdkPlatform>JDK 1.8</netbeans.hint.jdkPlatform>
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
</properties>
</project-shared-configuration>
So I have netbeans_2e_hint_2e_j2eeVersion set to 1.8-web and
netbeans_2e_hint_2e_deploy_2e_server set to gfv5ee8 as is in the answer. But still error of no suitable server deployment. How to resolve this?
Try this:
Right click project -> Properties -> Run.
Change Server to the one you want to use.
I've been doing static analysis on Java projects, which usually boils down to running javac2 #a_list_of_all_the_java_files_in_the_project, where javac2 is my modified compiler. Except, finding the right libraries to make everything compile is difficult.
I'm working with a project now (incidentally, eclipse SDK 3.7.1) that has a file artifacts.xml in the root folder. This file looks useful. My understanding so far is that it tells eclipse which libraries to use when opening the folder as an eclipse project. If so, I'd like to download these libraries locally and reference them in my custom compilation command.
Can someone explain the purpose of artifacts.xml, and optionally offer feedback on my approach? Ultimately all I want is to be able to compile the project on the command line using a nonstandard compiler.
First few lines or artifacts.xml
<?xml version='1.0' encoding='UTF-8'?>
<?artifactRepository version='1.1.0'?>
<repository name='Bundle pool' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>
<properties size='2'>
<property name='p2.system' value='true'/>
<property name='p2.timestamp' value='1315600353875'/>
</properties>
<mappings size='3'>
<rule filter='(& (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
<rule filter='(& (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
<rule filter='(& (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
</mappings>
<artifacts size='405'>
<artifact classifier='osgi.bundle' id='org.eclipse.ecf.provider.filetransfer.ssl' version='1.0.0.v20110531-2218'>
<properties size='1'>
<property name='download.size' value='8460'/>
</properties>
</artifact>
This is the file that the Eclipse 'p2' install system uses to describe a repository of installable artifacts. The file is sometimes compressed in to an artifacts.jar file.
Eclipse p2 is described here: http://wiki.eclipse.org/Equinox/p2
A maven artifact, in general, is a file that gets deployed to a maven repo.
artifacts.xml is the canonical way of listing everything that needs to be sent to said repository.
Check this previous post for more information:
What is a Maven artifact?
The version-numbers for our jars have to be longer them x.x.x.
We would rather need x.x.x.x to integrate some old-fashioned self-made mechanism.
This is, because we tag our software with x.x.x and as soon as we have a delivery to a customer one specific jar has to be build exactly at this point of time to fit to another backend,
which communicates with our program. For that reason this one jar has the version 2.3.4.1,
when generated and in next delivery of the same Version it is build and named 2.3.4.2.
Now artifactory cannot handle this an doesn't save more than x.x.x.2 in some cases.
So we thought of maybe edit the regular expression in the maven repository layout (see attached Screenshot) Because testing the path in the field below shows,
that it cannot handle the version number. Of course for the rest of our jars still x.x.x has to work..
For Example here is the maven-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.firm</groupId>
<artifactId>someid</artifactId>
<version>1.5.1</version>
<versioning>
<latest>1.5.1</latest>
<release>1.5.1</release>
<versions>
<version>1.4.62</version>
</versions>
<lastUpdated>20120926073942</lastUpdated>
</versioning>
</metadata>
The folder structure looks like:
someid
- 1.4.62
- 1.4.62.1
- 1.4.62.2
- 1.4.62.3
If we deploy an new artifact version (1.4.62.1), the maven-metadata.xml contains the 1.4.62.1 version.
But the artifactory overrides the version number (1.4.62.x) to (1.4.62) after an unspecified time. It seems that the artifactory only support major, minor and revision numbers, and deletes the buildnumber.
Now we looking for a solution do disable this behavior.
We use the JFrog Artifactory version 2.5.0 (rev. 13086).
I apologize in advance that this will be an unsatisfactory answer for you.
Your version format is incompatible with the version format used by Maven. Maven uses a .. format for version numbers. Anything after this needs to be prefaced with a dash for it to be properly used by Maven. For more information about how version numbers are used and formatted in Maven, please refer to this section of the Maven book: http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-syntax.html
Given the following repository URL from my pom.xml how can I determine what the latest versions of spring and hibernate are available in the repository?
http://repo1.maven.org/maven2
Retrieve the maven-metadata.xml file, placed in the artifact directory, e.g. https://repo1.maven.org/maven2/com/sun/media/jai_codec/maven-metadata.xml for an artifact with the groupId com.sun.media and artifactId jai_codec.
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.example</groupId>
<artifactId>project</artifactId>
<versioning>
<latest>0.0.5</latest>
<release>0.0.5</release>
<versions>
<version>0.0.3</version>
<version>0.0.4</version>
<version>0.0.5</version>
</versions>
<lastUpdated>20090725212606</lastUpdated>
</versioning>
</metadata>
Programatically or just manually?
Since the repository works over HTTP you can just navigate it manually:
http://repo2.maven.org/maven2/org/springframework/spring/
http://repo2.maven.org/maven2/org/hibernate/hibernate/
http://repo2.maven.org/maven2/org/hibernate/hibernate-core/
As Robert's answer says, the maven-metadata.xml file for each artifact in the repository holds the version information you need. In particular note the latest and release elements in the metadata. The latest element denotes the last version to be published, this may not be the version you want though. For example it could be a maintenance release to an older version, a release candidate, or a milestone. The release version denotes the last published version intended to be treated as a release, so generally you'd want to take this version.
For information the Maven super POM has a special release-profile profile, activated by setting the performRelease property (e.g. by passing -DperformRelease on the command line). Amongst other things, activating this property will set the updateReleaseInfo property of the deploy-plugin so that the metadata will be updated when you deploy.
Depending on what the real use case is, it can be worth looking at http://www.mojohaus.org/versions-maven-plugin/