MobHunting

MobHunting

114k Downloads

Cleaning up pom.xml

Rocologo opened this issue · 17 comments

commented

I have now deployed Factions to my repository server

https://fractal.lindegaard.one:8187/artifactory/plugins-release/com/massivecraft/factions/Factions/2.12.1/

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 :-(

commented

There is no Pom.xml in this part of the repo. Compare it with the working repo.

commented

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.

commented

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.

https://www.jfrog.com/confluence/download/attachments/46107909/DeployMaven1.png?version=1&modificationDate=1459433151000&api=v2

commented

I have now deployed Factions to my repository server

https://fractal.lindegaard.one:8187/artifactory/plugins-release/com/massivecraft/factions/Factions/2.12.1/

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 :-(

commented
commented

You see the difference? There is no pom.xml

bildschirmfoto 2017-06-26 um 22 19 57

commented

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

commented

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.

https://fractal.lindegaard.one:8187/artifactory/webapp/#/artifacts/browse/tree/General/plugins-release-local/com/massivecraft/factions/Factions/2.12.1/Factions-2.12.1.jar

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 ???

commented

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....

commented

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

commented

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!

commented

Can you do it by yourself now?
It seems that you're having the knowledge now.

commented

Yes, I can do it ! :-)

commented

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....

commented

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.

commented

To my knowledge my last Pom.xml is working fine without the jars from the lib folder. Try to update the Pom. Static conversion is barely doable with the current plugin-softwaredesign. Start listing all features the plugin has and start from scratch.