79965

Maven: Can not create Javadocs

Question:

I can not create javadocs to a folder I like, Here is how my javadoc plugin looks like;

<build> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version> <configuration> <outputDirectory>${build.dir}/resources/javadoc</outputDirectory> <reportOutputDirectory>${project.reporting.outputDirectory}/javadoc</reportOutputDirectory> </configuration> <executions> <execution> <id>attach-javadocs</id> <phase>package</phase> <goals> <goal>aggregate</goal> </goals> </execution> </executions> </plugin> </plugins> </build>

Any ideas?

EDIT MAven install leads to error"

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:aggregate (attach-javadocs) on project priTool: An error has occurred in JavaDocs report generation: [ERROR] Exit code: 1 - C:\pricing\priWebApp\src\main\..webapp\backend\local\PriUpgradeHelper.java:5: package ..upgrademanager does not exist [ERROR] import ...upgrademanager.ComponentInfo;

Upgrade Manager is an external dependency, but I can see its jar in library

Answer1:

You need to understand the difference between mvn package and mvn install. package creates the JARs in the target folder of the Maven project/module.

If there are more modules, they won't be able to see these JARs - for each project/module, Maven <strong>only</strong> looks into the local repository to resolve dependencies, even if could resolve them in the same project.

And that's what install does: Package the JARs and then install them into the local repository.

When you have a Maven project, with several modules (a.k.a a reactor build), then <strong>never</strong> use mvn package. <strong>Always</strong> use mvn install.

Recommend

  • Google Analytics API deviceCategory
  • Creating security domain using wildfly-maven-plugin has no effect
  • Presenting NSOpenPanel as sheet synchronously
  • Jenkins Build Error: Build step 'Invoke top-level Maven targets' marked build as failure
  • How to mount dynamically single file component in Vue.js
  • LatLong falls within a given polygon in D3 + Leaflet
  • Remove every nth element from swift array
  • Trouble Attaching Call Back to Unobtrusive Validation Show Error
  • Regarding client side code generation from WSDL
  • Visual Studio not stopping on an exception being thrown
  • maven-dependency-plugin ignores outputDirectory configuration
  • Maven-Release-Plugin: Force to use specific version of scm provider
  • Spring Batch restart uncompleted jobs from the same execution and step
  • Where in the relevant specification is it documented that some comments in a SQL script are, in fact
  • How to package a jar and all dependencies within a new jar with maven
  • How do I configure Maven Cargo to use an embedded Tomcat server?
  • reduce/reduce conflicts using ocamlyacc
  • How to detect left mouse click but not when the click occur on a UI Button component [closed]
  • What is the equivalent of Android permissions in iOS development? [duplicate]
  • how to read a file in prolog?
  • Thread synchronization with syncwarp
  • How to create two column output from a single column
  • C# Report Renderer for SRSS 2008 R2 - Missing Parameter
  • Does Apportable support to build library binary (.a/.so)?
  • Redshift Querying: error xx000 disk full redshift
  • Bash if statement with multiple conditions
  • where do I find the xml.dom python package for the python-2.6.0-8.9.28 and I have a suse/x86_64 vers
  • Spring boot 2.0.0.M4 required a bean named 'entityManagerFactory' that could not be found
  • How to remove a SwiftyJSON element?
  • Read text file that is not in the main package in a runnable jar
  • Roxygen error “Skipping invalid path”
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • Swift: Switch statement fallthrough behavior
  • Switching to Release Build causes runtime error in Web Reference
  • Lost migrations and Azure database is now out of sync
  • QuartzCore.framework for Mono Develop
  • How to delete a row from a dynamic generate table using jquery?
  • json Serialization in asp
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • How to stop GridView from loading again when I press back button?