Slow build Android Maven Project - java

I have a multi module Maven project and I need help to optimize the time spent to build my Android module. When running the goals "clean install" or "verify" concluded that the Android project is consuming most of the time. The summary of time spent on builds is shown below:
[INFO] ------------------------------------------------------------------
[INFO] Building M-SPLearning Parent 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------
[INFO] ------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] M-SPLearning Entity ................... SUCCESS [1.710s]
[INFO] M-SPLearning Repository ............... SUCCESS [0.226s]
[INFO] M-SPLearning Service .................. SUCCESS [0.115s]
[INFO] M-SPLearning RESTful .................. SUCCESS [2.925s]
[INFO] M-SPLearning Android .................. SUCCESS [38.153s] << The Problem
[INFO] M-SPLearning Parent ................... SUCCESS [0.000s]
[INFO] ------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------
[INFO] Total time: 44.430s
[INFO] Finished at: Tue Jan 28 23:24:54 BRST 2014
[INFO] Final Memory: 24M/137M
[INFO] ------------------------------------------------------------------
The full output console can be accessed here.
Like to know if there are ways to improve the time spent in the build of the Android project, because I need run the build procedure (programmatically) in one of my RESTful services and 45~60 seconds is too long to wait the response.
The project source code is stored on GitHub.
Already, thanks!

For starters I would upgrade to the Android Maven Plugin 3.8.1 (not 3.8.2 since that breaks apklib usage) and Maven 3.1.1 and then I would see what is actually slow. I have a feeling it is the dex run since you have a lot of dependencies. And if that is the case there is not much you can do.

Related

Why does Maven randomly stop seeing dependencies and how do I make it?

I have a Maven project using Jetty as a runner – in case it's relevant. My pom.xml file contains the following
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>7.17.3</version>
</dependency>
It used to be 7.14.2 and I upgraded it. After cleaning and refreshing, IntelliJ says some of the classes in one of the packages on which transport depends can't be found anymore. I tried forcing refreshes, cleaned the project multiple times, resolving dependencies... nothing, the project doesn't even build anymore because of those missing classes. I figured I'd downgrade it again, just in case I missed a breaking change somewhere but now I have the older version and the classes are still not there. I switched to a branch which I'm sure works and sure enough everything builds and runs just fine.
I checked with mvn dependency:tree and this is what comes up:
[INFO] +- org.elasticsearch.client:transport:jar:7.17.3:compile
[INFO] | +- org.elasticsearch:elasticsearch:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-core:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-secure-sm:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-x-content:jar:7.17.3:compile
elasticsearch-x-content is the package that is supposed to contain those classes and it shows up correctly (in the downgraded version too) but the classes are nowhere to be found.
I have had similar problems in the past where either Maven or IntelliJ IDEA randomly decide to stop seeing things that they were both happy to see just 20 minutes prior, and I never know how I manage to "fix" the issue each time so I don't have a repeatable series of incantations that I can offer as a clue.
Any ideas?
EDIT: I just tried a mvn dependency:purge-local-repository and no joy. I tried refreshing Maven from inside IntelliJ IDEA, nothing. I tried mvn compile and mvn package -U and nope.
EDIT 2: This is the error I'm getting on mvn compile:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[20,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
/Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[21,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
/Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[22,40] error: cannot find symbol
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.623 s
[INFO] Finished at: 2022-04-26T13:56:15+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project isaac-api: Compilation failure: Compilation failure:
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[20,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[21,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[22,40] error: cannot find symbol
Did you try running mvn compile from the command line and then refresing the project? Sometimes Intellij will bug out and not actually download a dependency even though it says it's trying to (happened to me a week ago).

Commit timestamp in Maven version using jgitver

I'm evaluating the jgitver Maven extension for calculating artefact versions from git metadata.
jgitver provides the commit datetime in a property called jgitver.head_commit_datetime, but I can't figure out how to include the timestamp in the version string.
Can anyone help?
#otto.poellath, you can use the configuration property useGitCommitTimestamp and set it to true ; it is only available in the non maven mode of jgitver as it is a bit clashing with strict maven SNAPSHOTs.
So if you have your .mvn/jgitver.config.xml config file that contains something like the following it will work:
<mavenLike>false</mavenLike>
<useGitCommitTimestamp>true</useGitCommitTimestamp>
Here is an output of a local mvn validate on jgitver-maven-plugin itself using such a configuration
H:\jgitver-maven-plugin>mvn validate
[INFO] using jgitver configuration file: H:\jgitver-maven-plugin\.mvn\jgitver.config.xml
[INFO] Scanning for projects...
[INFO] Using jgitver-maven-plugin [1.3.0] (sha1: ef8eec9f820d662e63a84f1210c377183e450cbd)
[INFO] jgitver-maven-plugin is about to change project(s) version(s)
[INFO] fr.brouillard.oss::jgitver-maven-plugin::0 -> 1.3.1-20180710075533-integration
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jgitver Maven Plugin 1.3.1-20180710075533-integration
[INFO] ------------------------------------------------------------------------
...
Thanks to maven lazy evaluation, you can provide them into the build using the versions plugin, something like:
mvn jgitver versions:set -DnewVersion=1.0.\${jgitver.head_commit_datetime} versions.commit
Try that and let me know.
It basically pass the property onto the versions:set plugin, and this will rewrite all pom files to the given new version.

Maven compile fails silently - Unresolved compilation problems

I have an interesting problem with a spring webapp maven build. When being built inside eclipse everything is fine yet when built via maven and deployed to a tomcat 8 container the webapp fails on startup with the following error:
Caused by: java.lang.NoClassDefFoundError: FilterConfig
Now I tried all the obvious and well documented dependency issues (setting scope provided on the javax.servlet-api & jsp-api import and making sure they are of the latest versions as this is a Java 8 project). I have made sure all of the complier plugins are of the latest versions:
maven-war-plugin
3.1.0
maven-compiler-plugin
3.6.1
yet the webapp fails to start with no errors being shown in the maven build console output. After much head-scratching and painstaking comparison between the (working) eclipse build and the mysteriously failing maven equivalent it was discovered that inside some of the class files generated by maven were texts describing compilation problems. (The following was extracted from the "Open With > Text Editor" option in eclipse against the .class file - some of the characters had to be omitted as they wouldn't copy correctly)
Unresolved compilation problems:
The import javax.servlet.Filter cannot be resolved
The import javax.servlet.FilterChain cannot be resolved
The import javax.servlet.FilterConfig cannot be resolved
The import javax.servlet.ServletException cannot be resolved
The import javax.servlet.ServletRequest cannot be resolved
The import javax.servlet.ServletResponse cannot be resolved
The import javax.servlet.http.HttpServletRequest cannot be resolved
The import javax.servlet.http.HttpSession cannot be resolved
Filter cannot be resolved to a type
FilterConfig cannot be resolved to a type
ServletException cannot be resolved to a type
ServletRequest cannot be resolved to a type
ServletResponse cannot be resolved to a type
FilterChain cannot be resolved to a type
ServletException cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpSession cannot be resolved to a type
I cannot understand how the maven process appears to complete successfully and that no errors are shown with any of the mvn goals I've tried
mvn complier:compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxx 2.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # EBPP ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # EBPP ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.413 s
[INFO] Finished at: 2017-06-28T15:11:45+01:00
[INFO] Final Memory: 9M/213M
[INFO] ------------------------------------------------------------------------
the above but with the -x showed a lot of debugging output but nothing to suggest compile problems, in fact it states that the class-file identified unresolved dependencies are included
...
[DEBUG] javax.servlet:javax.servlet-api:jar:3.1.0:provided
[DEBUG] org.apache.velocity:velocity:jar:1.7:compile
[DEBUG] commons-collections:commons-collections:jar:3.2.1:compile
[DEBUG] commons-lang:commons-lang:jar:2.4:compile
[DEBUG] javax.servlet.jsp:jsp-api:jar:2.2:provided
...
mvn dependency:build-classpath
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxx 2.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:build-classpath (default-cli) # EBPP ---
[INFO] Dependencies classpath:
C:\Users\xxxxxx\.m2\repository\org\springframework\webflow\spring-webflow\2.4.5.RELEASE\spring-webflow-2.4.5.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\xxxxxx\.m2\repository\opensymphony\ognl\2.6.11\ognl-2.6.11.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\webflow\spring-binding\2.4.5.RELEASE\spring-binding-2.4.5.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\webflow\spring-js\2.4.5.RELEASE\spring-js-2.4.5.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\webflow\spring-js-resources\2.4.5.RELEASE\spring-js-resources-2.4.5.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-beans\4.3.0.RELEASE\spring-beans-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-context\4.3.0.RELEASE\spring-context-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-aop\4.3.0.RELEASE\spring-aop-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-expression\4.3.0.RELEASE\spring-expression-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-web\4.3.0.RELEASE\spring-web-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-webmvc\4.3.0.RELEASE\spring-webmvc-4.3.0.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-core\4.3.9.RELEASE\spring-core-4.3.9.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\com\xxxxxxx\ebpp\JComms\2.0.1\JComms-2.0.1.jar;C:\Users\xxxxxx\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\xxxxxx\.m2\repository\javax\mail\mail\1.4.7\mail-1.4.7.jar;C:\Users\xxxxxx\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\xxxxxx\.m2\repository\org\apache\httpcomponents\httpclient\4.5.1\httpclient-4.5.1.jar;C:\Users\xxxxxx\.m2\repository\org\apache\httpcomponents\httpcore\4.4.3\httpcore-4.4.3.jar;C:\Users\xxxxxx\.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\xxxxxx\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;C:\Users\xxxxxx\.m2\repository\com\xxxxxxx\ebpp\JCore\2.0.1\JCore-2.0.1.jar;C:\Users\xxxxxx\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\Users\xxxxxx\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar;C:\Users\xxxxxx\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\xxxxxx\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;C:\Users\xxxxxx\.m2\repository\javax\servlet\jsp\jsp-api\2.2\jsp-api-2.2.jar;C:\Users\xxxxxx\.m2\repository\junit\junit\3.8.2\junit-3.8.2.jar;C:\Users\xxxxxx\.m2\repository\org\springframework\spring-context-support\4.3.9.RELEASE\spring-context-support-4.3.9.RELEASE.jar;C:\Users\xxxxxx\.m2\repository\com\xxxxxxx\xxxxxxx\440\xxxxxxx-440.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.331 s
[INFO] Finished at: 2017-06-28T15:13:05+01:00
[INFO] Final Memory: 13M/213M
[INFO] ------------------------------------------------------------------------
mvn validate
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxx 2.0.1
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.109 s
[INFO] Finished at: 2017-06-28T15:15:32+01:00
[INFO] Final Memory: 7M/213M
[INFO] ------------------------------------------------------------------------
I really am stumped. I'm presuming maven is using a different compiler from eclipse but I really have run out of ideas.
Has anyone else encountered this before?
Thanks in advance.
I suspect it's a combination of eclipse building your files with compilation errors (yes, Eclipse can do that: if you never reach the un-compilable code, then you don't even get errors) and Maven not cleaning the output of Eclipse first.
Then Maven sees that the file is up-to-date, and doesn't overwrite it.
I suggest the following (to check if I'm right):
Turn off Eclipse's automatic build (or stop eclipse altogether).
Run a Maven target, such as package but also run clean (i.e. mvn clean package); the point is to be 100% sure that Maven builds those files and not Eclipse.
Maven should now report compilation errors.
As for the error itself, it looks like you are indeed missing a dependency (but probably in Eclipse's classpath, not Maven's).
So when comparing this project to another successful project (that were both converted from Java 4), on the hunch that using non standard directory names was the cause for mavens erratic behavior (while copying the warSourceDirectory). I analysed the (now called) WebRoot > WEB-INF > classes directory and discovered that for the problematic app this had been populated, with you've guessed it - incorrectly compiled class files! Clearly the war plugin copied these bad files over the top of the files Maven had, in the same build process just successfully complied - hence no error.
I am unsure why the bad files were there as they were not in the old Java 4 project. I suspect that they must have been created somehow during a previous failed maven build using incorrect settings.

How does Maven work?

I need to send my Maven project(written in IDEA) to another guy. So I've got a question : which files exactly i should send. As i understand there are:
.idea folder , src folder and pom file. Afther this i just need to perform this command in directory with pom file on another computer:
mvn install
And i've got built project and jar file.Am i right?
If it is correct i've got a problem - i've got nothing in my local maven repository.
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Pa
ragonCase ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # Paragon
Case ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # ParagonCase ---
[INFO] Surefire report directory: C:\Users\Kru\IdeaProjects\PopularWords\target\
surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running MainTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.118 sec
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # ParagonCase ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # ParagonCase ---
[INFO] Installing C:\Users\Kru\IdeaProjects\PopularWords\target\ParagonCase-1.2.
jar to C:\Users\Kru\.m2\repository\ru\nick\kru\ParagonCase\1.2\ParagonCase-1.2.j
ar
[WARNING] Failed to create parent directories for tracking file C:\Users\Kru\.m2
\repository\ru\nick\kru\ParagonCase\1.2\_remote.repositories
[INFO] Installing C:\Users\Kru\IdeaProjects\PopularWords\pom.xml to C:\Users\Kru
\.m2\repository\ru\nick\kru\ParagonCase\1.2\ParagonCase-1.2.pom
[WARNING] Failed to create parent directories for tracking file C:\Users\Kru\.m2
\repository\ru\nick\kru\ParagonCase\1.2\_remote.repositories
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.874 s
[INFO] Finished at: 2016-03-31T20:25:37+03:00
[INFO] Final Memory: 10M/155M
[INFO] ------------------------------------------------------------------------
I need to send my Maven project(written in IDEA) to another guy. So I've got a question : which files exactly i should send.
The only things you need to send are pom.xml and the foldersrc. And you don't have to send the .idea folder because it is IDEA specific and nothing to do with Maven; so the receiver can choose his own favorite IDE.
And i've got built project and jar file.Am i right?
Yes, you're right.
If it is correct i've got a problem - i've got nothing in my local maven repository.
The project seems to have built correctly as you can see from the following log output:
[INFO] Installing C:\Users\Kru\IdeaProjects\PopularWords\target\ParagonCase-1.2.jar to C:\Users\Kru.m2\repository\ru\nick\kru\ParagonCase\1.2\ParagonCase-1.2.jar
To verify this you can go to the targetdirectory and see if the jar file is there.
Why you're not getting the artifacts in the local repository may have to do with the warning displayed where Maven is complaining that it cannot create parent directories:
[WARNING] Failed to create parent directories for tracking file C:\Users\Kru.m2\repository\ru\nick\kru\ParagonCase\1.2_remote.repositories
[INFO] Installing C:\Users\Kru\IdeaProjects\PopularWords\pom.xml to C:\Users\Kru.m2\repository\ru\nick\kru\ParagonCase\1.2\ParagonCase-1.2.pom
[WARNING] Failed to create parent directories for tracking file C:\Users\Kru.m2\repository\ru\nick\kru\ParagonCase\1.2_remote.repositories
So I would suggest that you investigate why Maven cannot create thos directories.
You should have something in your local .m2, but there's no need for you to send that to your partner. Maven will go out to the central repo if it doesn't find a JAR in the .m2.
If you're saying you have JARs that are private to your app that aren't available in any central Maven repo then you do have a problem. Anyone using your app will have to satisfy the dependencies when they build.
If you cannot put your app into GitHub and have others successfully build it by checking out, then you're doing it wrong.

jaxb episodic compilation with maven

I am trying to execute the maven-jaxb2-plugin-sample-episode-0.7.4 (explained here and with a download available) to try separate schema compilation. Despite it compiles the first schema (A), it fails in the second one (B) because it is not able to resolve the artifact maven-jaxb2-plugin-sample-episode-a-maven:jar:0.7.4.
I execute mvn assembly:assembly from the command line (windows) and this is the error I get:
...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven JAXB 2.x Plugin Sample [episode-b|maven]
[INFO] ------------------------------------------------------------------------
[INFO] [jaxb2:generate {execution: default}]
Downloading: http://repo1.maven.org/maven2/org/jvnet/jaxb2/maven2/maven-jaxb2-pl
ugin-sample-episode-a-maven/0.7.4/maven-jaxb2-plugin-sample-episode-a-maven-0.7.
4.jar
[INFO] Unable to find resource 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-sample
-episode-a-maven:jar:0.7.4' in repository central (http://repo1.maven.org/maven2
)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Could not resolve the artifact.
Embedded error: Missing:
----------
1) org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-sample-episode-a-maven:jar:0.7.4
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.jvnet.jaxb2.maven2 -DartifactId=mav
en-jaxb2-plugin-sample-episode-a-maven -Dversion=0.7.4 -Dpackaging=jar -Dfile=/p
ath/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.jvnet.jaxb2.maven2 -DartifactId=maven
-jaxb2-plugin-sample-episode-a-maven -Dversion=0.7.4 -Dpackaging=jar -Dfile=/pat
h/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-ample-episode-b-maven:jar:0
.7.4
2) org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-sample-episode-a-maven:jar:
0.7.4
----------
1 required artifact is missing.
for artifact:
org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-ample-episode-b-maven:jar:0.7.4
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Wed Dec 22 16:31:29 CET 2010
[INFO] Final Memory: 16M/39M
[INFO] ------------------------------------------------------------------------
The example should work as it is so, what am I doing wrong ? In the real scenario I have more than 10 schemas that have to be compiled as different episodes, so I need the proccess to be automatic (i.e no need to execute "mvn something" for each individual artifact)
The module maven-jaxb2-plugin-ample-episode-b-maven depends on maven-jaxb2-plugin-ample-episode-a-maven.
When mvn assembly:assembly is run from the parent folder (which contains the two modules), it builds the jar for maven-jaxb2-plugin-ample-episode-a-maven, but does not install it in your local repository.
When it then tries to build maven-jaxb2-plugin-ample-episode-b-maven, it looks for the dependency (maven-jaxb2-plugin-ample-episode-a-maven) and fails to find it in the local repository. Thus the error.
The question is, why would you want to run mvn assembly:assembly, which is used to create a binary distribution? There are no assembly descriptors in either module.
mvn install works fine and build both the modules successfully.

Categories

Resources