Skip to content

Commit

Permalink
WINDUPRULE-392 Java Version - Maven dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrizzi committed Nov 29, 2019
1 parent c82f3f7 commit 1c53abf
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 159 deletions.
Expand Up @@ -7,15 +7,6 @@
<name>Sample Project</name>

<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-linkedin</artifactId>
</dependency>
</dependencies>


</project>

This file was deleted.

@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<ruletest id="xml-java-versions-tests"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data/xml-java-versions</testDataPath>
<rulePath>../xml-java-versions.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="xml-java-versions-00001-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="`jaxb-api` Maven dependency missing*"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[xml-java-versions] 'jaxb-api' Maven dependency missing hint was not found!" />
</perform>
</rule>
<rule id="xml-java-versions-00002-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="`jaxb-core` Maven dependency missing*"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[xml-java-versions] 'jaxb-core' Maven dependency missing hint was not found!" />
</perform>
</rule>
<rule id="xml-java-versions-00003-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="`jaxb-impl` Maven dependency missing*"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[xml-java-versions] 'jaxb-impl' Maven dependency missing hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="maven-dependencies"
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="xml-java-versions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>
Expand All @@ -12,39 +12,7 @@
<targetTechnology id="camel" versionRange="[3,)" />
</metadata>
<rules>
<rule id="maven-dependencies-00000">
<when>
<xmlfile as="dependencies-block" matches="/m:project/m:dependencies" in="pom.xml">
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/>
</xmlfile>
<not>
<project>
<artifact groupId="com.sun.activation" artifactId="javax.activation" />
</project>
</not>
</when>
<perform over="dependencies-block">
<hint title="'javax.activation' Maven dependency missing" effort="1" category-id="potential">
<message>
<![CDATA[
`javax.activation` Maven dependency missing.
Apache Camel 3 supports Java 11 and in this Java version JAXB modules have been removed from the JDK, therefore you will need to add them as Maven dependencies since there are couple of components rely on them:
```Xml
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>${javax.activation.version}</version>
</dependency>
```
]]>
</message>
<link title="Camel 3 - Migration Guide: Java Versions" href="https://camel.apache.org/manual/latest/camel-3-migration-guide.html#_java_versions" />
</hint>
</perform>
</rule>
<rule id="maven-dependencies-00001">
<rule id="xml-java-versions-00001">
<when>
<xmlfile as="dependencies-block" matches="/m:project/m:dependencies" in="pom.xml">
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/>
Expand All @@ -67,7 +35,7 @@
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
<version>2.3.1</version>
</dependency>
```
]]>
Expand All @@ -76,7 +44,7 @@
</hint>
</perform>
</rule>
<rule id="maven-dependencies-00002">
<rule id="xml-java-versions-00002">
<when>
<xmlfile as="dependencies-block" matches="/m:project/m:dependencies" in="pom.xml">
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/>
Expand All @@ -99,7 +67,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.api.version}</version>
<version>2.3.0.1</version>
</dependency>
```
]]>
Expand All @@ -108,7 +76,7 @@
</hint>
</perform>
</rule>
<rule id="maven-dependencies-00003">
<rule id="xml-java-versions-00003">
<when>
<xmlfile as="dependencies-block" matches="/m:project/m:dependencies" in="pom.xml">
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/>
Expand All @@ -131,7 +99,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.api.version}</version>
<version>2.3.2</version>
</dependency>
```
]]>
Expand All @@ -140,33 +108,5 @@
</hint>
</perform>
</rule>
<rule id="maven-dependencies-00004">
<when>
<project>
<artifact groupId="org.apache.camel" artifactId="camel-linkedin" />
</project>
</when>
<perform>
<hint title="`org.apache.camel:camel-linkedin` artifact has been removed" effort="7" category-id="mandatory" >
<message>`org.apache.camel:camel-linkedin` artifact has been removed in Apache Camel 3 so it won't be available</message>
</hint>
</perform>
</rule>
<rule id="maven-dependencies-00005">
<when>
<project>
<artifact groupId="org.apache.camel" artifactId="camel-http4" />
</project>
</when>
<perform>
<hint title="`org.apache.camel:camel-http4` artifact has been moved" effort="1" category-id="mandatory" >
<message>`org.apache.camel:camel-http4` artifact has been moved in Apache Camel 3 to `org.apache.camel:camel-http` artifact</message>
<quickfix type="REPLACE" name="camel-http4-replace">
<replacement>camel-http</replacement>
<search>camel-http4</search>
</quickfix>
</hint>
</perform>
</rule>
</rules>
</ruleset>

0 comments on commit 1c53abf

Please sign in to comment.