Goldstein Lyor created CXF-7675:
-----------------------------------

             Summary: Extra dot required when specifying base packages to scan 
in Java2Wadl Maven plugins
                 Key: CXF-7675
                 URL: https://issues.apache.org/jira/browse/CXF-7675
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 3.2.2
         Environment: {noformat}
Maven home: /home/lyor/Software/apache-maven-3.5.2
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-5.b14.fc27.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.6-300.fc27.x86_64", arch: "amd64", family: 
"unix"
{noformat}
            Reporter: Goldstein Lyor


{code:xml}
<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-java2wadl-plugin</artifactId>
    <version>3.2.2</version>
    <executions>
        <execution>
            <id>generate-wadl</id>
            <goals>
                <goal>java2wadl</goal>
            </goals>
            <phase>process-classes</phase>
        </execution>
    </executions>
    <configuration>
        <attachWadl>true</attachWadl>
        <classResourceNames />
        <outputFileName>${project.artifactId}</outputFileName>
        <!-- NOTE: terminate packages with dots otherwise scanning yields 
nothing -->
        
<basePackages>com.cb4.base.rest.,com.cb4.cretail.rest.,com.cb4.cpatterns.rest.</basePackages>
    </configuration>
</plugin>
{code}
this is due to the following code:
  
{code:java|title=org.apache.cxf.common.util.SpringClasspathScanner#findClassesInternal}
 for (final String basePackage: basePackages) {
            final boolean scanAllPackages = basePackage.equals(WILDCARD);
            final String packageSearchPath = 
ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
                + (scanAllPackages ? "" : 
ClassUtils.convertClassNameToResourcePath(basePackage))
                + ALL_CLASS_FILES;
{code}
{code:java}
ClassUtils.convertClassNameToResourcePath(basePackage){code}
only converts '.' to '/', and since
{code:java}
    public static final String ALL_FILES = "**/*";
    public static final String ALL_CLASS_FILES = ALL_FILES + ".class";
{code}
so {{foo.bar.baz}} becomes {{classpath*:foo/bar/baz\*\*/\*.class}} instead of 
{{classpath*:foo/bar/baz/\*\*/\*.class}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to