user8918515
user8918515

Reputation:

Jar is not creating for spring boot

I am adding pluginManagement to avoid Failed to execute goal org.apache.openjpa:openjpa-maven-plugin:3.0.0:enhance (enhancer) on project Execution enhancer of goal org.apache.openjpa:openjpa-maven-plugin:3.0.0:enhance failed:

Error. but when I add pluginManagement it stops creating jar for my project.

    <build>
         <pluginManagement>
              <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>com.test.testApplication</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.6.201602180812</version>
            <configuration>
                <destFile>${sonar.jacoco.reportPath}</destFile>
                <append>true</append>
            </configuration>
            <executions>
                <execution>
                    <id>agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.openjpa</groupId>
            <artifactId>openjpa-maven-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <includes>**/tablemodels/*.class</includes>
                <addDefaultConstructor>true</addDefaultConstructor>
                <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
                <persistenceXmlFile>src/main/resources/META-INF/persistence.xml</persistenceXmlFile>
            </configuration>
             <executions>
                <execution>
                    <id>enhancer</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>enhance</goal>
                    </goals>
                </execution>
            </executions> 
        </plugin>
    </plugins>
     </pluginManagement>
</build>

If I remove pluginManagement from pom then Jar is getting created.

Upvotes: 0

Views: 60

Answers (1)

David
David

Reputation: 3937

My guess is that you just wrapped your <plugins> tag in a <pluginManagement> tag, which does not do what you want. I suggest you read the documentation to understand the relationship between plugin and pluginManagement. See also another post on StackOverflow.

As to your underlying problem: I guess the error you mention is an Eclipse error. It is emitted by the m2e plugin which requires a connector for each maven plugin in your pom.

You can usually come up with a connector (if it is not found on the Eclipse Marketplace) by typing " m2e connector" into your favorite search engine.

In this case you might want to install this: https://github.com/beskow/openjpa-maven-connector

Upvotes: 1

Related Questions