Hello I am using the latest version of Broadleaf (5.2.7). The project works perfectly fine running with HSQL. The problem is that I am trying to migrate to mysql. I am trying to follow the tutorials here and here
The problem is that I cannot find the dependancies in my root pom.xml that the tutorials mention
So for instance the tutorial mentions on step 3:
In your root pom.xml, find the following in the section under the with org.apache.tomcat.maven
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.3.1</version>
<type>jar</type>
<scope>compile</scope>
Where should this exist? I might have a huge misunderstanding here but I cannot find it.As far as I understand this is my root pom.xml (??) and it looks like this
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.broadleafcommerce</groupId>
<artifactId>broadleaf-boot-starter-parent</artifactId>
<version>5.2.7-GA</version>
<relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany-community</groupId>
<artifactId>boot-community-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Broadleaf Spring Boot Community Demo</name>
<repositories>
<repository>
<id>public snapshots</id>
<name>public snapshots</name>
<url>http://nexus.broadleafcommerce.org/nexus/content/groups/community-snapshots/</url>
</repository>
<repository>
<id>public releases</id>
<name>public releases</name>
<url>http://nexus.broadleafcommerce.org/nexus/content/groups/community-releases/</url>
</repository>
</repositories>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<google-closure-compiler.version>v20180506</google-closure-compiler.version>
<debug.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${debug.port}</debug.args>
<boot.jvm.memory>-Xmx1536M</boot.jvm.memory>
<boot.jvm.args>${boot.jvm.memory} ${debug.args}</boot.jvm.args>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.uri>${project.baseUri}</project.uri>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>${boot.jvm.args}</jvmArguments>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.7</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>jrebel</id>
<properties>
<boot.jvm.args>${boot.jvm.memory} ${debug.args} ${jrebel.agent.args}</boot.jvm.args>
</properties>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mycompany-community</groupId>
<artifactId>boot-community-demo-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler-unshaded</artifactId>
<version>${google-closure-compiler.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>core</module>
<module>site</module>
<module>admin</module>
<module>api</module>
</modules>
Any tips of what I am missing?
Thanks!!!
So I opened an issue at broadleaf's github and found a solution. This might be useful for anyone interested in the future:
https://github.com/BroadleafCommerce/DemoSite/issues/40
I would suggest to not follow the tutorials for migrating to mysql as it seems to be outdated. Follow the changes I describe in the github link.
The first time you create the db it might take up to 15+ minutes. Be prepared for that and don't stop the compiling process. After the first time you can change "blPU.hibernate.hbm2ddl.auto" from "create" to "none" or "update".
Finally after the update if you try and visit localhost:8081/admin you might get this error
2018-12-08 19:55:26.540 INFO 6616 --- [nio-8081-exec-3] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
As contributors informed there's no known solution for that so what you can do is go directly to the https link : https://localhost:8444/admin
Related
as stated I have trouble running mvn jetty:run with the existing vaadin exercise for routing in vs code. As the tutorial was already created under vaadin 10 the pom file is probably outdated, as the other trainigs worked perfectly fine with the mvn jetty:run command.
The exact error is:
No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\Dukatz\.m2\repository), central (https://repo.maven.apache.org/maven2)]
Sadly I'm pretty new do web application development, so I don't have the slightest idea, how to make it work. Hopefully you can help me.
The Tutorial: Vaadin Router Api Tutorial
the POM file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.vaadin.trainings.routing</groupId>
<artifactId>exercises-routing</artifactId>
<name>Routing Exercises</name>
<version>1.0.0</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Dependencies -->
<vaadin.version>13.0.5</vaadin.version>
<servlet.api.version>3.1.0</servlet.api.version>
<!-- Plugins -->
<jetty.version>9.4.15.v20190215</jetty.version>
<maven.war.plugin.version>3.1.0</maven.war.plugin.version>
</properties>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<name>Vaadin Pre-releases</name>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<type>pom</type>
<scope>import</scope>
<version>${vaadin.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Added to provide logging output as Flow uses -->
<!-- the unbound SLF4J no-operation (NOP) logger implementation -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
</plugin>
</plugins>
</build>
</project>
There is no Problem with the pom file. Because it's an older lesson, there was no pom file created for the whole project, but only in the specific paths (like \exercises or \solutions). So running mvn jetty:run couldn't work. There was no pom in the directory. I started it in VS-Code with the Maven-Explorer jetty plugin but
mvn jetty:run -f "c:\Users\Dukatz\Desktop\VadinTutorials\Vaadin14-RouterAPI\Exercises\pom.xml"
would do the job from the command line.
Thanks me! I won't delete the question because, one day there's maybe someone as dumb as me.
UPDATE: I see on this URL https://repo1.maven.org/maven2/io/swagger/swagger-codegen-maven-plugin/
that the only version of swagger codegen is 3.0.0-rc1
I'm trying to build a REST API with Java/SpringBoot and using the swagger-codegen plugin. I am able to use the plugin version of swagger codegen 2.3.1, it downloads fine for some reason.
However, I am trying to use Open api spec 3.0, and 2.3.1 would NOT work, and I found on Stackoverflow people saying I need to use 3.X.X of swagger-codegen to use open api spec 3.0.
So I changed the plugin version to 3.0.0, and 3.0.25 and many different versions but it keeps failing no matter what I do:
[ERROR] Plugin io.swagger:swagger-codegen-maven-plugin:3.0.0 or one of its dependencies could not be resolved: Could not find artifact io.swagger:swagger-codegen-maven-plugin:jar:3.0.0 in central (https://repo1.maven.org/maven2) -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin io.swagger:swagger-codegen-maven-plugin:3.0.0 or one of its dependencies could not be resolved: Could not find artifact io.swagger:swagger-codegen-maven-plugin:jar:3.0.0 in central (https://repo1.maven.org/maven2)
I was playing around with my settings.xml file and pom.xml but nothing seems to work. I'm confused because this JAR is on maven central, so it should be easily downloaded, correct? Also, I tried adding it as both a dependency AND plugin, and the dependency seems to be downloaded fine (even version 3.0.25), its just the plugin that fails all the time.
I will say I'm on a work computer being a proxy, but I added that info to the settings.xml - could that be related?
my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.mydomain.me</groupId>
<artifactId>my-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>My API</name>
<description>Version 2.0 of my API</description>
<properties>
<java.version>11</java.version>
</properties>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Maven Central</name>
<layout>default</layout>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-cli</artifactId>
<version>3.0.25</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.25</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
<output>${project.basedir}/target/generated-sources</output>
<language>java</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I don't know if it helps, but I was facing a similar problem. The thing is that the dependency was downloaded to the .m2 folder, but it was not reflecting on Maven Dependencies inside Libraries in Eclipse. So I ran this command inside the project where I needed the plugin: mvn swagger-codegen:generate. And then the files I needed were generated. I have no idea why the plugin wasn't being showed in Eclipse, but somehow it was there, hidden.
The groupId of swagger-codegen-maven-plugin has changed. Should be:
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.35</version>
<plugin>
Reading from the doc ,
Do not attempt to import a pom that is defined in a submodule of the current pom. Attempting to do that will result in the build
failing since it won't be able to locate the pom.
Never declare the pom importing a pom as the parent (or grandparent, etc) of the target pom. There is no way to resolve the
circularity and an exception will be thrown.
When referring to artifacts whose poms have transitive dependencies the project will need to specify versions of those artifacts as
managed dependencies. Not doing so will result in a build failure
since the artifact may not have a version specified. (This should be
considered a best practice in any case as it keeps the versions of
artifacts from changing from one build to the next).
I have the following doubt:
a) What does point 3 mean ?
b) In 1st point , why would maven not able to find the sub module pom ? Is not submodule build before the parent ?
In point 3 , I need more clarity on ...When referring to artifacts whose poms have transitive dependencies the project will need to specify versions of those artifacts as managed dependencies....
So, let us say we have project A which we will be imported in our project B <dependencyManagement> section . Now the people who created project A have to mention versions of all transitive dependencies (not direct) of project A in its <dependencyManagement> section ? How can anybody know those versions for all transitive dependencies of project A ?
I got another doubt with point 1. I created basically an skeletal project with a super module and sub module with basically no java code. I will hence share their poms. We will see that build gets successful while this should not be the case according to point 1.
The project structure is as follows :
The pom of super module is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.home</groupId>
<artifactId>my-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>my-project</name>
<url>http://www.example.com</url>
<modules>
<module>./sub-module1/pom.xml</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.home</groupId>
<artifactId>sub-module1</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The pom for sub module is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.home</groupId>
<artifactId>sub-module1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>
When I do mvn clean compile , it builds fine.
Also, I see that even if sub module pom packaging type be kept as jar, scope import does not throw error. It still compiles fine.
For future readers I will summarize the answer. Both points 1 and 2 holds true but it will give error only when POM1 (parent or super module) imports POM2 (sub module or child module) and then POM2 needs POM1 for resolution of dependencies.
In point 1 , this won't be found. In point 2 , it will be found due to inheritance but will create a cycle.
Below I give example so that people can verify.
Super module POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.home</groupId>
<artifactId>my-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>my-project</name>
<url>http://www.example.com</url>
<modules>
<module>./sub-module1/pom.xml</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.home</groupId>
<artifactId>sub-module1</artifactId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Sub Module POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.home</groupId>
<artifactId>sub-module1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>
</dependencies>
</project>
b) In 1st point , why would maven not able to find the sub module pom ? Is not submodule build before the parent ?
The submodule is not installed/deployed in a GAV referential (your maven cache or a remote Nexus repo)
That means any project which would reference a submodule pom would not find said pom in a submodule GAV, since what was built, installed and deployed was the main project GAV.
As khmarbaise adds in the comments:
You should never do a <scope>import</scope> inside a project which is already defined as a submodule which means is listed one <module>..</module> entry. Because the resolution of the import scope will be done before the rest which will result in a fail of the build.
And:
a) What does point 3 mean ?
It means the <dependencies> section should declare some <dependency> with only <group> and <artifact>, not <version>.
The version will be fetched from the imported <dependencyManagement>.
See also "Tracking managed dependency versions in Maven".
As illustrated here, managed dependency is used to lock the version at the parent pom.
I am upgrading my system's Maven runtime from 3.0.5 to 3.1.1 and trying to build my project using mvn clean install like I normally would. Using the older Maven runtime, the build would always succeed. However, I am now always getting this error message during the build:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project XYZ: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor failed: 48188 -> [Help 1]
I thought that perhaps it was due to my dependencies and plugins being outdated, so I ran mvn versions:use-latest-versions to update my pom.xml versions. That still did not fix this issue. Any ideas?
UPDATE
By popular demand, here is what my pom.xml file looks like. Note that all dependency and plugin versions were updated by mvn versions:use-latest-versions except for Sitebricks and qdox, due to breaking changes that I didn't want to integrate into my project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.company</groupId>
<artifactId>my-own-project</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>My Cool Maven Plugin</name>
<packaging>maven-plugin</packaging>
<distributionManagement>
<repository>
<id>someID</id>
<url>http://some.url.com</url>
</repository>
</distributionManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.11</version>
</dependency>
<dependency>
<groupId>com.google.sitebricks</groupId>
<artifactId>sitebricks</artifactId>
<version>0.8.5</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<effort>Max</effort>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
</project>
Upgrading and using below dependency with config resolved my issue:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
I had exactly the same problem and tried probably every hint provided in the possible duplicate Basic maven plugin project not working, Mojo plugin descriptors not generating, but nothing worked. Eventually in turned out that an old version 2.6.1 of the library com.ibm.icu:icu4j that was used by some other 3rd party module was responsible. I got rid of the icu4j dependency entirely and maven-plugin-plugin run with out problems thereafter.
I am rather new to Maven and I am having trouble using it. I have a working Android app, which uses aChartEngine, that runs fine in Eclipse but I need to use Maven for testing. There has been a repository set up for ACE but I can't seem to access it properly. Here is my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.my-app</groupId>
<artifactId>my-app</artifactId>
<packaging>apk</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>my-app</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.achartengine</groupId>
<artifactId>achartengine</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>achartengine</id>
<name>Public AChartEngine repository</name>
<url>https://repository-achartengine.forge.cloudbees.com/snapshot/</url>
</repository>
</repositories>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<!-- platform or api level (api level 16 = platform 4.1)-->
<platform>17</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
Is there something I'm doing wrong here? Let me know if I can add any more information.
Note that I am not using Maven from Eclipse, I am running it in a command prompt on windows 7.
UPDATE: I think I have found the problem but I'm not sure yet, so I'll still post the error message:
[ERROR] Failed to execute goal on project my-app: Could not resolve
dependencies for project com.mycompany:my-app:apk:0.0.1-
SNAPSHOT: Could not find artifact org.achartengine:achartengine:jar:1.1.0 in ...(my companies repository)
It turned out that the jar was not loaded into the repository that was being used. Got it all functional now.