What is in the gradle group, module and artifact?

There is not enough time in gradle docs to explain the entities they deal with. That is why I want to ask such a basic question.

I need to understand what the terms group, module, and artifact really mean to change this code:

compile('com.thoughtworks.xstream:xstream:1.4.7') { exclude group: 'xmlpull', module: 'xmlpull' } 

About a year ago, I used this exclusive statement, which I accepted from the conversion of dalvik for Android to xmlpullparser to fix the failure of several Dex files.

However, after updating to Android Studio 3.0, this error repeats again! Now he says: Multiple dex files define Lorg/xmlpull/mxp1/MXParser , and sometimes ...XmlPullParserException.java So, id would like to understand how the parameters that I give exclude should be set.

Considering the documentation, you might think that the group is the name of the package, and the class is the artifact :

 //excluding a particular transitive dependency: exclude module: 'cglib' //by artifact name exclude group: 'org.jmock' //by group exclude group: 'org.unwanted', module: 'iAmBuggy' //by both name and group 

Another Chinese page ( translated ) is used exc

  compile ( 'com.thoughtworks.xstream: xstream: 1.4.7' ) { exclude group : 'xmlpull' exclude group : 'XmlPullParser' } 

A miracle built on this find

  • How did xmlpull work when a package name starts with org.xmlpull ?
  • What projects mean these terms in my script. Where is the group name defined?
  • What is the XmlPullParser group?
  • Should I clean, rebuild or just build a project after changing these parameters? Because sometimes he complains about different files.
0
android android-gradle gradle xmlpullparser xstream
source share
1 answer

The group, artifact, and version are semi randomly selected and DO NOT have to match the packages or classes in the jar file.

For example, commons-lang has groupId = 'commons-lang' , but the classes are in the package org.apache.commons.lang.*

The group, artifact, and version are defined in the project build file. In maven it will be pom.xml in gradle, it will be in build.gradle (and settings.gradle )

If you want to know the group, artifact, version for the project (also known as GAV, aka maven), you usually go to the project home page.

You can also use the maven central advanced search in a "fuzzy" search, for example, using artifactId or using the class name in the bank. If you use your own repository, you can probably have a “fuzzy” web-based search there as well

0
source share

All Articles