Why maven aggregator project looks for jar file to install? - maven

I have an aggregator POM (<packaging>pom) with a few modules. The modules build fine but the aggregator itself has a strange error. When I do mvn clean install on the aggregator it normally calls default-install and installs the pom.xml in the local repository. But then right after that it calls the additional-install and looks for a JAR file in the project target directory to install to the local repository but it does not find a JAR file and fails.
Why does Maven try to install a JAR file from an aggregator project where an aggregator project never builds a JAR file so why is it trying to find one to install?
There is no error other than this and mvn clean package builds fine because it doesn’t involve installing.
The project is complex so I didn’t paste any code. If anyone could give me a clue as to why an aggregator POM with <packaging>pom would try to install a JAR I would appreciate it very much.

Related

how to add my custom jar dependencies to my webapplication?

I have child project with some dependencies. When I upload this jar to nexus it's ok.
But when I use this jar in my webapplication and I use mvn clean install -U command. Maven create a war, but the child project dependencies isn't in the war lib folder.
What is the problem?
Check with mvn dependency:tree on the project. Often, the problem is a wrong scope. Make sure the dependencies all have scope compile.

How to build maven project With existing jar in local maven repository

I have issue with Project Building in Maven. I have updated some code in one of the dependency jars which is available in Maven Repository .I need to build my project with the jar i have modified.How to do that .Kindly Help me.
1. Install mvn project
Make sure to install your changed code into your repository.
Run following maven command for your updated library project.
mvn install
2. Check dependency
Check if the version of your library project match with the dependency entry in your main project pom.
E. g. if you install version "1.1" make sure the dependency entry is also "1.1"

where to place customer jar in maven project structure

I have a dependency application jar from other maven applications,and currently added it to my application path,
I want to know how this application related jar can be automatically moved my local repository folders.
I think it should be placed in somewhere in maven project folder structure so that when maven build the module it automatically moves to the repository.
Dependent project:
If built with maven, you would issue a mvn install, when building it.
If not built with maven, install it locally using mvn install:install-file
http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html

Maven and Jsig CAS 4.0RC

I have downloaded the code from the repository but I have little experience to use maven (command line) to get the .war file to be included in my tomcat.
I do not have experience in this.
I have not changed the pom.xml file
I directly run the command mvn clean package but I have several errors.
Spete help me?
My goal is to generate the. War file CAS 4.0RC
I'm using the pom.xml file that I found on git (a very long file) can fit that?
If you've downloaded the source of CAS and its by itself should be a mavenized project then, pom.xml should be inside.
so you should just 'cd' to the root folder of your source and type
mvn install
or
mvn package
The first command will install your jar into local maven repository, the second one will only prepare the war in the target folder of the module with packaging war in the source.
If you encounter any errors, please post them here.
Hope this helps
It should build without any problem when executing mvn clean install in the CLI... What are your errors ?

tycho plugin + maven-dependency-plugin: copy dependencies from local projects instead repositories

Main Goal: deploy a project as jar and eclipse-plugin
current state: project builds fine as jar package
Now i want to create a second project which wraps the jar project as eclipse plugin
use tycho-maven-plugin to create eclipse-plugin
add the jar of the original project (with copy-dependency)
add an Activator
export packages from jar
create correct MANIFEST.MF
i tried to copy the jar with copy-dependencies bound to create-resources. This works as long the jar is found in repository, but the local project gets ignored.
This results in a build failure since the jar is not found.
Is it possible to tell copy-dependencies to take the jar from the target directory of the project? Or should i use some other method than using tycho?
Edit:
I solved my problem with 4 projects:
normal project (nothing special here)
the wrapper project using tycho maven and copy-dependencies.
bound copy dependencies to some goal before compile (e.g. generate-resources). Excluded all artefactid which were set as dependency in the MANIFEST.MF.
a prepare project, which calls the normal project and installs it into the repo. This is needed because the tycho-maven-plugin is bound to validate and it is not possible to call the exec plugin beforehand (at least not easy).
a multi module project which calls the prepare project before the wrapper project.
Build your local project (which artifact was missed) with "mvm install". It will be deployed in your local repository ($USER_HOME$/.m2/repositories). After this dependency should be resolved.
Alternatively you can "mvn deploy" if you have local company maven repository like Artifactory or Nexus.

Resources