Home > Mobile >  Having problems to build maven application
Having problems to build maven application

Time:03-14

I have a project called auth-chatapp which I'm trying to run the following command line (in order to build and download all of the dependencies): mvn clean install -DskipTests=true -X -U.

One of the dependencies points to a multi module maven project called chat-components in which I use the Jitpack to build and make the artifact available to use as a dependency.

When I try to run the command line or even when it runs the build on Travis ci, it generates the following log file: https://drive.google.com/file/d/1gXV96n2dL_aypvDUqV28GomYnOjhtulV/view?usp=sharing

When I run the command line above, the dependencies inside the chat-components are resolved (just search for the jitpack repository inside the log and you can see that) but there seems to be a problem inside the chat-entities submodule (I'm not sure it's a problem inside the project because the build runs perfectly in the Jitpack) which can be seen in the log towards the end of the file: Could not find artifact com.chatcomponents:chat-components:pom:${revision} in google-maven-central (https://maven-central.storage-download.googleapis.com/maven2/) -> [Help 1].

Another thing that I am not sure why is happening is why it is trying to get this artifact com.chatcomponents:chat-components:pom:${revision} from google-maven-central when the dependencies I have declared inside the auth-chatapp do not point to there.

CodePudding user response:

The auth-chatapp started working after adding the following under the tag plugins in the pom:

      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>flatten-maven-plugin</artifactId>
         <version>1.1.0</version>
         <configuration>
           <updatePomFile>true</updatePomFile>
           <flattenMode>resolveCiFriendliesOnly</flattenMode>
         </configuration>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
  • Related