Comments (21)
I want to comment on the maven plugin point of view (as oppose to the extension).
Currently, executing the plugin would likely lead to this same issue. The plugin now works in a way that all project submodules are processed (their dependencies upgraded), but that's mostly because I wasn't sure what is the most suitable way the plugin should work. This shows that perhaps more reasonable default mode of operation would be that only the (execution) root module is processed, as @jfdenise suggested. The plugin could also make this configurable.
In general I agree that the plugin should provide enough flexibility to workaround such issues. I think we will also need an ability to exclude particular streams from being applied, avoid upgrading dependencies to the project submodules, etc. It very much depends on particular use case.
from wildfly-channel.
I'm not sure to understand what the issue is.
The Channel API is not meant to fetch artifacts used by tests, only those provisioned by WildFly.
Afaics, WildFly only requires a single version of Hibernate: https://github.com/wildfly/wildfly/blob/f8f05aede00ff12fad9a303f9b905f4ea90051eb/pom.xml#L433
from wildfly-channel.
I think multi-version support for Hibernate came to an end with https://issues.redhat.com/browse/WFLY-15607
We may see a need for multi-version support in EAP 8.
Prior to this you would see the same as we would see on eap-7.4.x:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1-jboss-1:testCompile (default-testCompile) on project wildfly-ormtransformer: Compilation failure: Compilation failure:
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/BitSetType.java:[38,8] cannot access javax.persistence.PersistenceException
[ERROR] class file for javax.persistence.PersistenceException not found
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/ProcedureParameterExtractionAwareType.java:[26,8] org.jboss.as.hibernate.test.ProcedureParameterExtractionAwareType is not abstract and does not override abstract method extract(java.sql.CallableStatement,java.lang.String[],org.hibernate.engine.spi.SharedSessionContractImplementor) in org.hibernate.type.ProcedureParameterExtractionAware
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/ProcedureParameterExtractionAwareType.java:[33,5] method does not override or implement a method from a supertype
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/ProcedureParameterExtractionAwareType.java:[38,5] method does not override or implement a method from a supertype
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/MyPersistentCollection.java:[34,8] org.jboss.as.hibernate.test.MyPersistentCollection is not abstract and does not override abstract method setCurrentSession(org.hibernate.engine.spi.SharedSessionContractImplementor) in org.hibernate.collection.spi.PersistentCollection
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/MyPersistentCollection.java:[82,5] method does not override or implement a method from a supertype
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/MyPersistentCollection.java:[87,5] method does not override or implement a method from a supertype
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/MyPersistentCollection.java:[88,73] incompatible types: org.hibernate.HibernateException cannot be converted to java.lang.Throwable
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/MyPersistentCollection.java:[103,20] incompatible types: org.hibernate.HibernateException cannot be converted to java.lang.Throwable
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/BitSetTypeDescriptor.java:[79,9] incompatible types: org.hibernate.HibernateException cannot be converted to java.lang.Throwable
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/BitSetTypeDescriptor.java:[92,9] incompatible types: org.hibernate.HibernateException cannot be converted to java.lang.Throwable
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/ProcedureParameterNamedBinderType.java:[26,8] org.jboss.as.hibernate.test.ProcedureParameterNamedBinderType is not abstract and does not override abstract method nullSafeSet(java.sql.CallableStatement,java.lang.Object,java.lang.String,org.hibernate.engine.spi.SharedSessionContractImplementor) in org.hibernate.type.ProcedureParameterNamedBinder
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate-transformer/src/test/java/org/jboss/as/hibernate/test/ProcedureParameterNamedBinderType.java:[33,5] method does not override or implement a method from a supertype
[ERROR] -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1-jboss-1:compile (default-compile) on project jipijapa-hibernate4-1: Compilation failure: Compilation failure:
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[28,51] package org.hibernate.service.jta.platform.internal does not exist
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[29,51] package org.hibernate.service.jta.platform.internal does not exist
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[30,51] package org.hibernate.service.jta.platform.internal does not exist
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[37,91] package org.hibernate.service.jta.platform.internal does not exist
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[39,19] cannot find symbol
[ERROR] symbol: class JtaSynchronizationStrategy
[ERROR] location: class org.jboss.as.jpa.hibernate4.JBossAppServerJtaPlatform
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JBossAppServerJtaPlatform.java:[63,15] cannot find symbol
[ERROR] symbol: class JtaSynchronizationStrategy
[ERROR] location: class org.jboss.as.jpa.hibernate4.JBossAppServerJtaPlatform
[ERROR] -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1-jboss-1:compile (default-compile) on project jipijapa-hibernate4-3: Compilation failure: Compilation failure:
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/HibernatePersistenceProviderAdaptor.java:[87,58] cannot find symbol
[ERROR] symbol: variable USE_NEW_ID_GENERATOR_MAPPINGS
[ERROR] location: class org.hibernate.cfg.Configuration
[ERROR] /var/jenkins_home/workspace/vbe-eap-7.4.x-build/workdir/jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/HibernatePersistenceProviderAdaptor.java:[88,80] cannot find symbol
[ERROR] symbol: variable SCANNER
[ERROR] location: interface org.hibernate.ejb.AvailableSettings
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :wildfly-ormtransformer
from wildfly-channel.
Its not tests per se. When maven kicks in, it builds project tree and populates deps from info it can find - be it compile, runtime or tests scope, does not matter.
This issue actually covers two problems:
- AFAIR - no way to discriminate major/minor/micro - whatever is in repos and defined in channel, will be sucked as latests.
- Different integration parts of build may depend on different API versions, it should be possible to restrict search in some way
from wildfly-channel.
@baranowb can you please expand on the issue?
The Channel API main goal is to provision WildFly where we should have only 1 version of any Maven Artifact.
It seems that you encounter this issue when you are using the Channel lib to build WildFly (where we could have multiple versions of the same artifact for testing).
from wildfly-channel.
For WFLY it might work as it does not need to bother with long lived versions. EAP on the other hand does not have luxury. Also, Im fairly sure one of key points in having channel defs is to be able to provision specific version/ranges so maven repository does not have to be sanitazed (as it is now)
from wildfly-channel.
@baranowb Can you show me an example of a WildFly/EAP version where we were shipping different versions of the same GA
? I'm curious to see how they would be defined in the pom.xml that was used to build it.
The Channel API is meant to curate the latest version of a Maven GA
artifact according to a version
or version/range
constraint but it is not designed to curate multiple versions of the same GA
. I want to understand the scope of that requirement before making that change.
from wildfly-channel.
@baranowb , we have different artifactId for hibernate jipijapa versions, each one referenced in a slot per hibernate version. Artifacts GA are different for different versions. So the problem you identified is not at provisioning time, right?
The problem seems to be when building. We can build against different versions of the same GA. The extension/maven plugin that will resolve version from a channel and inject versions during the build will be impacted by that.
Taking hibernate as an example, we have multiple versions for hibernate-core used at compile time. To compile jipijapa4.1 we use hibernate-core 4.2.13.Final, for jipijapa4.3 we use hibernate-core 4.3.10.Final).
But these versions don't end in the provisioned server, just compile time. A user would have to provide his own hibernate version to work with the associated jipijapa.
from wildfly-channel.
@jmesnil - not shipped, AFAIR provisioning by users was one of key aspects?
@jfdenise Sort of, provisioning can happen only after build/test phase - and for such cases multiple versions are needed for build/test phase.
from wildfly-channel.
I would leave out the build phase. Yes we do have multiple versions of Hibernate in there, but this is because we want to support multiple API versions.
Which brings it to testing. For testing the Maven modules contain runtime test coverage for each of the different API contracts. So each module would need to see a different version of Hibernate matching the API version used in building.
from wildfly-channel.
So each module would need to see a different version of Hibernate matching the API version used in building
The different versions of Hibernate are used for testing. They should have a <scope>test</scope>
, right?
The channel library must not be used to fetch any Maven artifacts but only those that are part of the runtime server.
Depending on their scope, some of these artifacts will not be fetched through the channel library.
If we want to use this lib to "inject" version into WildFly building/testing, there needs to have some checks on which maven artifacts this applies to.
from wildfly-channel.
@wolfc , where are these tests located? I can only find tests in the repo that test the latest hibernate version.
from wildfly-channel.
https://github.com/wildfly/wildfly/tree/25.0.0.Final/jpa (and its EAP fork)
from wildfly-channel.
@wolfc , thank-you. That is where I found the various versions of hibernate (for example: https://github.com/wildfly/wildfly/blob/25.0.0.Final/jpa/hibernate4_3/pom.xml#L19) but I missed the test dir in hibernate4_3. The build and test inside this module are both depending the same dependency on hibernate-core. What is specific to tests?
from wildfly-channel.
You can see in the stacktrace I posted earlier how each module is affected individually.
The difference between build & test is the fact that we want to build against a given API and test against the latest. In theory we should be able to use Hibernate 4.3.0.Final for the build and should use Hibernate 4.3.11.Final for testing (not 4.3.10.Final).
from wildfly-channel.
@wolfc , I think we are on the same page. By using a single version of hibernate-core (the one in the channel), we break the transformer test compilation that expect 5.1, and each jipijapa_4x that expect a given 4.x version. The way the hibernate4_3 module is designed, only a single version is used for both build (API contract) and tests.
But in the end, can't it be fixed in the maven plugin/extension that inject the versions? If it does the resolution in the parent project (raw thinking), the sub modules that override the version (the hibernate modules that do that) should override what the extension/plugin has injected. Similar to what occurs without the plugin. No?
from wildfly-channel.
Depending on their scope, some of these artifacts will not be fetched through the channel library.
If we want to use this lib to "inject" version into WildFly building/testing, there needs to have some checks on which maven artifacts this applies to.
That's a fundamental flaw. Provisioning cant happen without testing(and in case of our CI, build phase). Because you cant be sure if provisioning of certain version wont break something. There are two distinct flows:
- curation of possible versions( this includes testing against proposed versions)
- on-site provisioning of WFLY/EAP
From POV of extension/plugin there is no way to determine which modules should not be processed(or so to say relevant way, other than 'scope') - its either all or non/blacklisting, which makes no sense.
In order to automate testing of certain version Channels have to allow such discrimination to happen, either via API or as outcome of yaml rules/defs?
from wildfly-channel.
@baranowb , do you have some examples of that with 7.4? The only reference I found on dealing with artifacts with multiple versions was hibernate, and in this case the versions are hardcoded in the submodule. So the hardcoded value should still win. Do we have other cases?
Thank-you.
from wildfly-channel.
Any progress on resolving this issue? Will this be closed or are we planning changes to the channels specification?
from wildfly-channel.
We can keep this issue as an enhancement but we don't need to fix it for our initial release.
from wildfly-channel.
We can keep this issue as an enhancement but we don't need to fix it for our initial release.
@baranowb Are you okay with that?
from wildfly-channel.
Related Issues (20)
- Verify the integrity of components coming from channels
- Splitting channel metadata into Channel and Manifest files HOT 3
- Clarification on Stream.version HOT 3
- Fix link to json-schema HOT 1
- Verify manifest ID has only valid characters
- Allow configuring maven checksum policy via a system property
- Add contributing and other community docs to wildfly-channel
- HttpProxy cannot set setURLStreamHandlerFactory when Prospero is used under a modular environment.
- During version resolution, MavenVersionResolver ignores versions deployed locally even if the same version is available in remote
- Use matrix builds in the 'main.yaml' GitHub Actions workflow; test SE 11, 17, 21
- Combining multiple channels fails when `resolve-if-no-stream: maven-release` is used
- The retry logic in the VersionResolver fails if one of the repositories is unavailable HOT 3
- Support versionPatterns in blocklists
- Incorrect resolution of the latest manifest from G:A HOT 3
- Required channel load order HOT 4
- Streams for artifacts with classifiers HOT 2
- Parralel resolution of available versions HOT 4
- Cannot create instance of class org.wildfly.channel.maven.ChannelCoordinate
- Support a blocklisting of excluded artifact versions HOT 3
- Advanced Maven resolution strategies HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wildfly-channel.