Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages not found if source code isn't in src/main/java #2

Open
Jeevi21 opened this issue Jun 2, 2016 · 5 comments
Open

Packages not found if source code isn't in src/main/java #2

Jeevi21 opened this issue Jun 2, 2016 · 5 comments

Comments

@Jeevi21
Copy link

Jeevi21 commented Jun 2, 2016

This is my apisource

     <apiSource>                
                <locations>appstore.partner.rest.resources</locations>
                <apiVersion>v1</apiVersion>
                <host>http://slczff.us.com:701/</host>
                <basePath>/myapis</basePath>
                <info>
                    <title>Swagger Maven Plugin Sample</title>
                    <version>v1</version>
                    <description>My sample</description>
                    <termsOfService>TermsOfService</termsOfService>
                    <contact>
                        <email>[email protected]</email>
                        <name>My Apis</name>
                        <url>http://apis.com</url>
                    </contact>
                    <license>
                        <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
                        <name>Apache 2.0</name>
                    </license>
                </info>

                 <!---Swagger JSON parameters BEGIN-->
                <swaggerDirectory>generated/swagger-ui</swaggerDirectory>                    
                <useOutputFlatStructure>false</useOutputFlatStructure>
                <!---Swagger JSON parameters END-->
     </apiSource>

location - is the package which needs to be scanned.
Swagger.json is getting generated. But details about my api's are not included in json.
can anyone help me in getting it right?
Thanks,
Jeevi N

@cstroe
Copy link
Owner

cstroe commented Jun 2, 2016

Reading the documentation of swagger-maven-plugin, it seems you're specifying the locations tag incorrectly. It should be like this:

<locations>
    <location>oracle.cloud.appstore.partner.rest.resources</location>
</locations>

Please make the correction to your configuration and try again. If this fixes the issue, please close the issue.

@Jeevi21
Copy link
Author

Jeevi21 commented Jun 2, 2016

Hi i tried your solution. But its not working... I got the below error.

  bash-4.1$ ant -file build_swagger.xml
  Buildfile: build_swagger.xml
  swaggertask.init:
  swaggertask.first:
  BUILD FAILED
  build_swagger.xml:59: locations doesn't support the nested "location" element.

@cstroe cstroe closed this as completed Jun 2, 2016
@cstroe cstroe reopened this Jun 2, 2016
@cstroe
Copy link
Owner

cstroe commented Jun 2, 2016

I will have to investigate this further.

@Jeevi21
Copy link
Author

Jeevi21 commented Jul 1, 2016

My resource files are not under /src/main/java... I think that s the problem.. Is there any way to give customized src path?

@cstroe
Copy link
Owner

cstroe commented Feb 4, 2017

@Jeevi21 The path where your source files are located is a Maven configuration in your pom.xml:

...
<build>
    <sourceDirectory>path/to/src</sourceDirectory>
    ...
</build>
...

But since this is an Ant task that's wrapping a Maven plugin, there's a disconnect there, and I didn't take care of that special case.

Would you be interested in working on this?

@cstroe cstroe changed the title My package is not getting Scanned Packages not found if source code isn't in src/main/java Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants