Cleaning up pom.xml
Rocologo opened this issue · 17 comments
@ysl3000 Thank you for your help!
https://github.com/Chazmondo/AdvancementAPI/blob/master/pom.xml#L20-L25
This is the mockito dependency.
OFF TOPIC:
Install your local dependencies to a maven repository.
Here is a tutorial: https://www.jfrog.com/confluence/display/RTF/Deploying+Artifacts
It'll minimize your project size.
I think that this https://github.com/Rocologo/MobHunting/blob/master/pom.xml#L787-L798 can be used as a maven repository for your files. Here is the web panel https://fractal.lindegaard.one:8187/artifactory/webapp/#/home
https://github.com/Rocologo/MobHunting/blob/master/pom.xml#L466-L662
https://github.com/Rocologo/MobHunting/blob/master/pom.xml#L691-L722
https://github.com/Rocologo/MobHunting/blob/master/pom.xml#L732-L757
Why not using the Logger available in Bukkit?
https://github.com/Rocologo/MobHunting/blob/master/pom.xml#L765-L781
I have now deployed Factions to my repository server
But when I try to use it
<dependency>
<groupId>com.massivecraft.factions</groupId>
<artifactId>Factions</artifactId>
<version>2.12.1</version>
</dependency>
my pom fails ??? I guess Im missing something :-(
There is no Pom.xml in this part of the repo. Compare it with the working repo.
So what you suggest is that I import the jar directly to my Artifactory server ? and let Maven find the the artifacts there?
<dependency>
<groupId>me.eccentric_nz.tardisweepingangels</groupId>
<artifactId>TARDISWeepingAngels</artifactId>
<version>${TARDISWeepingAngels.jar.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/${TARDISWeepingAngels.jar.version}</systemPath>
</dependency>
In this case I should upload TARDISWeepingAngels.jar ? Maven write a warning every time I compile my plugin, I just didnt know how to do this anyother way.
The way I do this now, is how Google and Youtube learned me to :-) I'm not developer by living, although I work with IT.
This link explains it very well https://www.jfrog.com/confluence/display/RTF/Deploying+Artifacts
The image beyond is taken from the link above. It's an example how the artefact should get named.
Use the package name of each file for groupID, the artifactid is your name of the plugin and the version will be the number beyond the hiven or the version number of the plugin.yml version.
Type -> keep it jar, cause it's a jar.
I have now deployed Factions to my repository server
But when I try to use it
<dependency>
<groupId>com.massivecraft.factions</groupId>
<artifactId>Factions</artifactId>
<version>2.12.1</version>
</dependency>
my pom fails ??? I guess Im missing something :-(
Did you add the tick generate default pom? Idk if this fixes the problem.
https://gist.github.com/ysl3000/4b3460b1d6e1bf4c96950f3601a124c6
<repository>
<id>fractal</id>
<url>https://fractal.lindegaard.one:8187/artifactory/plugins-release/</url>
</repository>
<dependency>
<groupId>com.massivecraft.factions</groupId>
<artifactId>Factions</artifactId>
<version>2.12.1</version>
<scope>provided</scope>
</dependency>
It works. :D
Understood. When I deploy the jar files to the repository I have and option "Generate Default POM / Deploy Jar's Internal POM", so I checked this on, and the pom files were auto-created.
And I was told that my dependency declaration should be
<dependency>
<groupId>com.massivecraft.factions</groupId>
<artifactId>Factions</artifactId>
<version>2.12.1</version>
<type>pom</type>
</dependency>
But I can still not compile my plugin... ????? I dont know what I am doing wrong.
Maybe its something with my depencies. I have never understod why there is both a
<dependencies>
<dependency>
.........
</dependency>
</dependecies>
and a <dependecyManagement>
block ???
But still get a red X on my pom file, and an error text "Failed to read artifact descriptor for com.massivecraft.factions.Factions:jar:......"
It so annoying....
Show me your current Pom.xml
I‘ll do a cleanup and make a list which plugins need to get into the maven repository.
I‘ll do it at 5-6pm gmt+2
I have pushed my code including the pom.xml to Github.
https://github.com/Rocologo/MobHunting
This triggers a new build on my Jenkins Server and this job was okay. Which made me realize that the problem was local on my workstation. So I tried to run maven with "clean install -U" to force an update and this solved the problem and removed the red X on my POM file! So now I am ready to deploy the rest of the artifacts and update the pom.
I'm in GMT+2 as well (Denmark) so I will to this tonight!
Thank you very much for you help, I really appreciate this!
Can you do it by yourself now?
It seems that you're having the knowledge now.
I still mis three jar files. For some reason it does not work when I deploy the jar file, and try to use it in the pom.xml file....
I tried to change all the static methods to non-static, but it introduced too many bugs, so I decided to rollback.
I still want to change from static to non-static, but I have to it in smaller steps, because I need to test everything to make sure that I dont break the plugin. The plugin is pretty stable at the moment, so I dont want to make to big changes without being in control. :-)
I close this ticket for now.