4

I have a project downloaded from git. Here is the link to source code https://github.com/dwdyer/reportng, I have downloaded it and now I am trying to create a JAR file and then want to attach it to maven repository. When I compile it using mvn compile and mvn package, it gives me the same INFO message, and in my target folder there is a jar file is created. But only pom.xml and pom.properties are shown inside it, instead of whole hierarchy of compiled class files replaced with Java files

thisisdude
  • 543
  • 1
  • 7
  • 31

3 Answers3

1

Maven is very picky about following a very specific folder layout in the given project (which you can override but it is not really intended to do so).

Instead you may want to just install the generated jar file directly in your local repository using the mvn install:install command.

If you want to script this, see Multiple install:install-file in a single pom.xml for instructions on how to create a pom.xml doing this.

Community
  • 1
  • 1
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

First of all, you have to debug problem:

cd reportng/
mvn -e clean install

-e switch on errors' trace. If everything ok, install will add jar just created jar file to your local repository.

Then it will be available as dependency to any project:

<dependency>
    <groupId>org.uncommons</groupId>
    <artifactId>reportng</artifactId>
    <version>1.1.4</version>
</dependency>

By the way:

Jar is available in maven central, so referencing it as dependency, having compile time internet connection, will be enough.

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
0

This can be solved by changing the Maven strusture. Maven must contain src/main/java, whereas in the program it is src/java/main

thisisdude
  • 543
  • 1
  • 7
  • 31