spring-cloud / spring-cloud-contract

Support for Consumer Driven Contracts in Spring
https://cloud.spring.io/spring-cloud-contract
Apache License 2.0
718 stars 439 forks source link

Error for spring-cloud-contract-maven-plugin #364

Closed vishukadam closed 7 years ago

vishukadam commented 7 years ago

I am creating spring cloud contract for my application. When include

org.springframework.cloud spring-cloud-contract-maven-plugin 1.1.0.BUILD-SNAPSHOT true................. I get the following error: Stubs could not be found: [E:\XhubIPass_SpringBoot\xhubipaassourceuse1\target\stubs] . Please make sure that spring-cloud-contract:convert was invoked (org.springframework.cloud:spring-cloud-contract-maven-plugin: 1.1.0.BUILD-SNAPSHOT:generateStubs:default-generateStubs:package) org.apache.maven.plugin.MojoExecutionException: ..... I have already included the following : org.eclipse.m2e lifecycle-mapping 1.0.0 .......................
marcingrzejszczak commented 7 years ago

I can't help you much cause you haven't provided the command that you have executed.

BTW Please format the code appropriately the next time you have an issue.

vishukadam commented 7 years ago

I beg apology for it. I am trying to implement it for Messaging with Kafka.

When I include the following tag in pom.xml of my project:

<plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

I get the following error:

Stubs could not be found: [D:\STS_WORKSPACE\XhubIPass_SpringBoot\xhubipasssourceuse1_contract\target\stubs] .
Please make sure that spring-cloud-contract:convert was invoked (org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.2.BUILD-SNAPSHOT:generateStubs:default-generateStubs:package)

org.apache.maven.plugin.MojoExecutionException: Stubs could not be found: [D:\STS_WORKSPACE\XhubIPass_SpringBoot\xhubipasssourceuse1_contract\target\stubs] .
Please make sure that spring-cloud-contract:convert was invoked

One of the solution I found on internet was:

<pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.gmavenplus ........

But its still not working as per expectations. I have also followed the sample on Spring cloud contract.

marcingrzejszczak commented 7 years ago

You still haven't written what you are actually executing. To sum up what you wrote

How can I help you if you don't provide the full information? Maybe upload your sample somewhere and write exactly the steps to reproduce the problem

vishukadam commented 7 years ago

I am tying to implement Spring Clod Contract. I have created contract (i.e groovy file). I have added plugins dependencies in the pom.xml as per the sample code.

<plugin>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-contract-maven-plugin</artifactId>
                <version>1.1.0.BUILD-SNAPSHOT</version>
                <extensions>true</extensions>
                <configuration>
                    <packageWithBaseClasses>com.xhub.ipaas</packageWithBaseClasses>                 
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework.cloud</groupId>
                        <artifactId>spring-cloud-contract-verifier</artifactId>
                        <version>1.1.0.BUILD-SNAPSHOT</version>
                        <!-- <scope>test</scope> -->
                    </dependency>

When i do "mvn install" on the project i get following error:

[ERROR] Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) on project xhubipasssourceuse1_contract: Stubs could not be found: [D:\STS_WORKSPACE\XhubIPass_SpringBoot_PACTCONTRACT\xhubipasssourceuse1_contract\target\stubs] .
[ERROR] Please make sure that spring-cloud-contract:convert was invoked
[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.

On pom.xml it shows error icon on the plugin and error is as below:

Stubs could not be found: [D:\STS_WORKSPACE\XhubIPass_SpringBoot_PACTCONTRACT\xhubipasssourceuse1_contract\target\stubs] . Please make sure that spring-cloud-contract:convert was invoked 
 (org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.0.BUILD-SNAPSHOT:generateStubs:default-generateStubs:package) org.apache.maven.plugin.MojoExecutionException: Stubs could not be found: [D:
 \STS_WORKSPACE\XhubIPass_SpringBoot_PACTCONTRACT\xhubipasssourceuse1_contract\target\stubs] . Please make sure that spring-cloud-contract:convert was invoked at 
 org.springframework.cloud.contract.maven.verifier.GenerateStubsMojo.createStubJar

Please find the code in following location: https://drive.google.com/file/d/0BzWNiabb0p3Pend3RXpVZml6dTQ https://drive.google.com/file/d/0BzWNiabb0p3PeEJzZlBuN3BXaE0 common is just dependency.

Inconvenience regretted.

marcingrzejszczak commented 7 years ago

Hi.

Please read this link on how to format the code in Github cause I had to manually fix the formatting for you - https://help.github.com/articles/creating-and-highlighting-code-blocks/

Please find the code in following location: https://drive.google.com/file/d/0BzWNiabb0p3Pend3RXpVZml6dTQ https://drive.google.com/file/d/0BzWNiabb0p3PeEJzZlBuN3BXaE0 common is just dependency.

Please update your code to Github or any other Git repository. This is the place to store code, not the Google Drive.

marcingrzejszczak commented 7 years ago

Closing due to inactivity