-
Notifications
You must be signed in to change notification settings - Fork 88
guide migration oasp3 to devon3.1
-
Automatic migration with devcon doesn’t work with parent pom’s; you need to migrate every single subproject on it’s own.
-
If your subproject’s don’t contain the old oasp4j or devon4j version number you have to copy your parent pom file into your child pom files and then use the migrate command.
-
use the devon4j migation command
-
after migration you need to update the version tag in the pom file manually. If you’re working with a parent pom you also need to update the version tag of the parent reference in the child pom file.
-
In case you are using eclipse, now you have to update and rebuild all your maven projects (alt + F5)
-
Change the super class from AbstractJsonDeserializer to JsonDeserializer
-
Implement unimplemented methods or change the methode signatur from Pageable deserializeNode(JsonNode node) to Pageable deserialize(JsonParser p, DeserializationContext context)
-
To get the JsonNode you need to use the following methods with the JsonParser p: JsonNode node = p.getCodec().readTree(p);
-
To get values of properties, you need to change from getRequiredValue(node, "property", String.class) to JacksonUtil.readValue(node, "property", String.class, false);
whereString() (StringSearchConfigTo) method or similar:
-
Check the parameter type with attetion on the source of the used class (the classes may have the same name but the one from oasp4j is obsolete)
-
Delete the old import of oasp4j (for example import io.oasp.module.beanmapping.common.api.BeanMapper) and import the new class of devon4j (for example import com.devonfw.module.beanmapping.common.api.BeanMapper)
-
There maximum three chnages that needed to be done in the logback.xml file
-
Change the logging properties tag from
<property resource="io/oasp/logging/logback/application-logging.properties" />
to<property resource="com/devonfw/logging/logback/application-logging.properties" />
-
Change the appenders file all tag from
<include resource="io/oasp/logging/logback/appenders-file-all.xml" />
to<include resource="com/devonfw/logging/logback/appenders-file-all.xml" />
-
Change the appender console tag from
<include resource="io/oasp/logging/logback/appender-console.xml" />
to<include resource="com/devonfw/logging/logback/appender-console.xml" />
-
You can replace all net.sf.mmm.util imports with the appropriate com.devonfw.module imports. For example "import net.sf.mmm.util.entity.api.GenericEntity" to "import com.devonfw.module.basic.common.api.entity.GenericEntity"
-
Except the TransferObject and the AbstractTransferObject. These are replaced with the denvonfw AbstractTo. Example: "import net.sf.mmm.util.transferobject.api.AbstractTransferObject" or "import net.sf.mmm.util.transferobject.api.TransferObject" to "import com.devonfw.module.basic.common.api.to.AbstractTo".
-
Change the @ComponentScan annotation from
@ComponentScan(basePackages = { "io.oasp.module.beanmapping" })
to@ComponentScan(basePackages = { "com.devonfw.module.beanmapping" })
. -
Now you have to create a variable
DOZER_MAPPING_XML
with following content:static final String DOZER_MAPPING_XML = "config/app/common/dozer-mapping.xml"
. -
Then you create an list beanMappings where you add the variable created in step 2.
-
To get an Mapper instance you now have to use a builder like
Mapper mapper = DozerBeanMapperBuilder.create().withMappingFiles(beanMappings).build()
. -
Change occurrences of
io.oasp.module.beanmapping.common.impl.dozer.IdentityConverter
indozer-mappings.xml
tocom.devonfw.module.beanmapping.common.impl.dozer.IdentityConverter
-
Migration of dozer 5 to 6.4: https://github.com/DozerMapper/dozer/blob/master/docs/asciidoc/migration/v6-to-v61.adoc https://github.com/DozerMapper/dozer/blob/master/docs/asciidoc/migration/v61-to-v62.adoc https://github.com/DozerMapper/dozer/blob/master/docs/asciidoc/migration/v62-to-v63.adoc https://github.com/DozerMapper/dozer/blob/master/docs/asciidoc/migration/v63-to-v64.adoc
-
In addition, the semantics of
<mapping type="one-way">
seems to be changed. If you for example just needed to exclude files on mapping from a to b one-way, you now have to declare an empty mapping as well from b to a one-way without any field(-extension) declarations to enable mapping from b to a at all. See also https://github.com/DozerMapper/dozer/issues/605 and https://github.com/DozerMapper/dozer/issues/451
In the pom.xml file you have to do some manuall changes. You need to change all oasp dependencies to denvonfw dependencies. Here are some examples:
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-beanmapping</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-beanmapping</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-security</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-security</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-web</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-web</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.starters</groupId> <artifactId>oasp4j-starter-cxf-client-rest</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.starters</groupId> <artifactId>devon4j-starter-cxf-client-rest</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.starters</groupId> <artifactId>oasp4j-starter-cxf-client-ws</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.starters</groupId> <artifactId>devon4j-starter-cxf-client-ws</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.starters</groupId> <artifactId>oasp4j-starter-cxf-server-rest</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.starters</groupId> <artifactId>devon4j-starter-cxf-server-rest</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.starters</groupId> <artifactId>oasp4j-starter-spring-data-jpa</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.starters</groupId> <artifactId>devon4j-starter-spring-data-jpa</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-batch</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-batch</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-test</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-test</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-logging</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-logging</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-jpa-spring-data</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-jpa-spring-data</artifactId> </dependency>
-
from
<dependency> <groupId>io.oasp.java.modules</groupId> <artifactId>oasp4j-rest</artifactId> </dependency>
to
<dependency> <groupId>com.devonfw.java.modules</groupId> <artifactId>devon4j-rest</artifactId> </dependency>
If you use the MutableGenericEntity<> class you have to change it to the PersistenceEntity<> class. Change the import "net.sf.mmm.util.entity.api.MutableGenericEntity" to "import com.devonfw.module.basic.common.api.entity.PersistenceEntity".
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International).