Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why no new Ivy version yet? #68

Closed
wants to merge 1 commit into from
Closed

Conversation

chinhodado
Copy link
Contributor

I'm just making this PR because the mailing list is a pain to use and there's no issue tracker here on GitHub for the project...but why isn't there a new release for Ivy yet, given the project has resumed development for so long now?

@jaikiran
Copy link
Member

jaikiran commented Feb 9, 2018

There will be one soon. There's a discussion going on, in the mailing list to work towards a release soon.

@twogee
Copy link
Contributor

twogee commented Feb 9, 2018

We have a PR where we lack a consensus for (#57) because it adds a new method to an important interface. To break the logjam, it could be postponed to the next release if that targets Java 8 which allows default method implementations in an interface. There are a couple of PRs (#55 and #60) that change UX by use of vector graphics; those can be postponed as well and synced with introduction of vector graphics in Ant (there's a SVG logo for Ant out there). Could somebody review the rest of PRs, please?

@sutchark
Copy link

sutchark commented Mar 1, 2018

Tested this with the latest release (2.4.0) and also a build of the latest master.

Fetching all dependencies of:
organisation="io.playn" module="playn-java-lwjgl" revision="2.0"

Most of the dependencies are just fetched fine but it doesn't fetch all necessary dependencies from organisation='org.lwjgl'

Tested this with Maven and Gradle. Both fetch the dependencies correctly.

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

What's missing?

$ java -jar build/artifact/jars/ivy.jar -dependency io.playn playn-java-lwjgl 2.0
:: loading settings :: url = jar:file:/ant-ivy/build/artifact/jars/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: io.playn#playn-java-lwjgl-caller;working
	confs: [default]
	found io.playn#playn-java-lwjgl;2.0 in public
	found io.playn#playn-java-base;2.0 in public
	found io.playn#playn-core;2.0 in public
	found com.samskivert#pythagoras;1.4.3 in public
	found com.threerings#react;1.5.3 in public
	found com.googlecode.soundlibs#mp3spi;1.9.5-1 in public
	found com.googlecode.soundlibs#jlayer;1.0.1-1 in public
	found com.googlecode.soundlibs#tritonus-share;0.3.7-1 in public
	found org.java-websocket#Java-WebSocket;1.3.0 in public
	found org.lwjgl#lwjgl;3.1.2 in public
	found org.lwjgl#lwjgl-opengl;3.1.2 in public
	found org.lwjgl#lwjgl-glfw;3.1.2 in public
	found junit#junit;4.12 in default
	found org.hamcrest#hamcrest-core;1.3 in default

@sutchark
Copy link

sutchark commented Mar 1, 2018

I used the code below to download all dependencies.

You see the output at the very bottom. Here are the 13 direct compile dependencies it should download:
https://mvnrepository.com/artifact/io.playn/playn-java-lwjgl/2.0

It only downloads some OSX jars for lwjgl. Also the content of those jars is somehow wrong when you open them.

Here is the correct jar for content comparison: http://central.mav en.org/maven2/org/lwjgl/lwjgl/ 3.1.2/lwjgl-3.1.2.jar

Very confusing.

The file ivy2.xml looks like this:

<ivy-module version="2.0"> <info organisation="apache" module="hello-ivy"/> <dependencies> <dependency org="io.playn" name="playn-java-lwjgl" rev="2.0"/> </dependencies> </ivy-module>

`import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;

import org.apache.ivy.Ivy;
import org.apache.ivy.core.LogOptions;
import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.core.report.ResolveReport;
import org.apache.ivy.core.retrieve.RetrieveOptions;
import org.apache.ivy.core.settings.IvySettings;

public class IvyApiExperiments {

public static void main(String[] args) throws ParseException, IOException {
	IvySettings ivySettings = new IvySettings();
	// Now let's set the basedir of the ivy settings to some location
	File baseDir = new File(".");
	System.out.println("baseDir: " + baseDir.getAbsolutePath());
	ivySettings.setBaseDir(baseDir);
	
	// create an ivy instance
	Ivy ivy = Ivy.newInstance(ivySettings);
	
	// That's where my ivy-settings.xml is located
	File ivySettingsXmlFile = new File("./ivysettings.xml");
	System.out.println(ivySettingsXmlFile.getAbsolutePath());
	// configure ivy to use the settings file
	ivy.configure(ivySettingsXmlFile);
	
	
	
	System.out.println("\n\n1. Define Dependencies\n\n");

	// file containing the list of dependencies (ex: ivy.xml)

// File dependencyFile = new File("./ivy-2.0.xml");
File dependencyFile = new File("./ivy2.xml");

	System.out.println("\n\n2. Resolve Dependencies\n\n");
	
	// resolve the dependencies - Ivy returns a report of the resolution
	ResolveReport resolveReport = ivy.resolve(dependencyFile);
	
	// check for errors (if any) during resolve
	if (resolveReport.hasError()) {
		List<String> problems = resolveReport.getAllProblemMessages();
		if (problems != null && !problems.isEmpty()) {
			StringBuffer errorMsgs = new StringBuffer();
			for (String problem : problems) {
				errorMsgs.append(problem);
				errorMsgs.append("\n");
			}
			System.err.println("Errors encountered during dependency resolution for package :");
			System.err.println(errorMsgs);
		}
	} else {
		System.out.println("Dependencies in file " + dependencyFile + " were successfully resolved");
	}
	
	
	System.out.println("\n\n3. Retrieve Dependencies\n\n");
	
	// Now that the dependencies have been resolved, let now retrieve them
	// Get the descriptor
	ModuleDescriptor md = resolveReport.getModuleDescriptor();
	// module revision id of the module whose dependencies were resolved
	ModuleRevisionId mRID = md.getModuleRevisionId();
	 
	// options that we pass to ivy instance for retrieve the dependencies
	RetrieveOptions retrieveOptions = new RetrieveOptions();
	 
	// folder to which we want the dependencies retrieved
	File destFolder = new File("./retrieved");
	 
	// the Ivy pattern which will be used for retrieving the dependencies
	String pattern = destFolder + "/[organization]/[module]/[type]/[artifact]-[revision].[ext]";
	retrieveOptions.setDestIvyPattern(pattern);
	 
	// default logging option
	retrieveOptions.setLog(LogOptions.LOG_DEFAULT);
	 
	// retrieve them!
	int packagesRetrieved = ivy.retrieve(mRID, pattern, retrieveOptions);
	 
	System.out.println("Retrieved " + packagesRetrieved + " dependencies");
}

}
`

`:: resolving dependencies :: apache#hello-ivy
confs: [default]
found io.playn#playn-java-lwjgl;2.0 in public
found io.playn#playn-java-base;2.0 in public
found io.playn#playn-core;2.0 in public
found com.samskivert#pythagoras;1.4.3 in public
found com.threerings#react;1.5.3 in public
found com.googlecode.soundlibs#mp3spi;1.9.5-1 in public
found com.googlecode.soundlibs#jlayer;1.0.1-1 in public
found junit#junit;3.8.2 in public
found com.googlecode.soundlibs#tritonus-share;0.3.7-1 in public
found org.java-websocket#Java-WebSocket;1.3.0 in public
found org.lwjgl#lwjgl;3.1.2 in public
found org.lwjgl#lwjgl-opengl;3.1.2 in public
found org.lwjgl#lwjgl-glfw;3.1.2 in public
downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0-sources.jar ...
....... (14kB)
.. (0kB)
[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar(source) (79ms)
downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0-javadoc.jar ...
................ (37kB)
.. (0kB)
[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar(javadoc) (92ms)
downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0.jar ...
............. (31kB)
.. (0kB)
[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar (95ms)
downloading https://repo1.maven.org/maven2/io/playn/playn-java-base/2.0/playn-java-base-2.0.jar ...
................ (67kB)
.. (0kB)
[SUCCESSFUL ] io.playn#playn-java-base;2.0!playn-java-base.jar (123ms)
downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl/3.1.2/lwjgl-3.1.2-natives-macos.jar ...
................ (33kB)
.. (0kB)
[SUCCESSFUL ] org.lwjgl#lwjgl;3.1.2!lwjgl.jar (109ms)
downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl-opengl/3.1.2/lwjgl-opengl-3.1.2-natives-macos.jar ...
.............. (43kB)
.. (0kB)
[SUCCESSFUL ] org.lwjgl#lwjgl-opengl;3.1.2!lwjgl-opengl.jar (117ms)
downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl-glfw/3.1.2/lwjgl-glfw-3.1.2-natives-macos.jar ...
.............. (42kB)
.. (0kB)
[SUCCESSFUL ] org.lwjgl#lwjgl-glfw;3.1.2!lwjgl-glfw.jar (115ms)
downloading https://repo1.maven.org/maven2/io/playn/playn-core/2.0/playn-core-2.0.jar ...
...................... (172kB)
.. (0kB)
[SUCCESSFUL ] io.playn#playn-core;2.0!playn-core.jar (178ms)
downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/mp3spi/1.9.5-1/mp3spi-1.9.5-1.jar ...
.............. (32kB)
.. (0kB)
[SUCCESSFUL ] com.googlecode.soundlibs#mp3spi;1.9.5-1!mp3spi.jar (89ms)
downloading https://repo1.maven.org/maven2/org/java-websocket/Java-WebSocket/1.3.0/Java-WebSocket-1.3.0.jar ...
.................. (100kB)
.. (0kB)
[SUCCESSFUL ] org.java-websocket#Java-WebSocket;1.3.0!Java-WebSocket.jar (131ms)
downloading https://repo1.maven.org/maven2/com/samskivert/pythagoras/1.4.3/pythagoras-1.4.3.jar ...
............................................... (572kB)
.. (0kB)
[SUCCESSFUL ] com.samskivert#pythagoras;1.4.3!pythagoras.jar (420ms)
downloading https://repo1.maven.org/maven2/com/threerings/react/1.5.3/react-1.5.3.jar ...
...................... (164kB)
.. (0kB)
[SUCCESSFUL ] com.threerings#react;1.5.3!react.jar (223ms)
downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/jlayer/1.0.1-1/jlayer-1.0.1-1.jar ...
.................... (135kB)
.. (0kB)
[SUCCESSFUL ] com.googlecode.soundlibs#jlayer;1.0.1-1!jlayer.jar (181ms)
downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/tritonus-share/0.3.7-1/tritonus-share-0.3.7-1.jar ...
......................... (215kB)
.. (0kB)
[SUCCESSFUL ] com.googlecode.soundlibs#tritonus-share;0.3.7-1!tritonus-share.jar (213ms)
downloading https://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar ...
................... (117kB)
.. (0kB)
[SUCCESSFUL ] junit#junit;3.8.2!junit.jar (184ms)
:: resolution report :: resolve 5367ms :: artifacts dl 2403ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 13 | 13 | 13 | 0 || 15 | 15 |
---------------------------------------------------------------------
Dependencies in file ./ivy2.xml were successfully resolved

  1. Retrieve Dependencies

:: retrieving :: apache#hello-ivy
confs: [default]
0 artifacts copied, 28 already retrieved (0kB/155ms)
Retrieved 0 dependencies
`

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

Oh, I see. We're looking at the same result, except you somehow keep an older version of junit (in my case JUnit 3 is evicted). The bug is (as you stated) that only platform-specific wjgl jars are downloaded. Somehow the presence of classifier makes Ivy ignore the artifact withouth them.

@sutchark
Copy link

sutchark commented Mar 1, 2018

True. The JUnit3 part is strange. My example above wasn't with the current master but the ivy-2.4.0.jar. Maybe that's the reason.

Ignoring the platform-specific wjgl jars is only one part of the problem.

Please go in the .ivy cache and look at the content of for example: org/lwjgl/lwjgl/ 3.1.2/lwjgl-3.1.2.jar

Here is the correct jar for content comparison: http://central.mav en.org/maven2/org/lwjgl/lwjgl/ 3.1.2/lwjgl-3.1.2.jar

When you look at the content of the jar, it isn't identical with the same jar stored on maven central.

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

This is another case of IVY-1576; maybe related to IVY-1484 and IVY-1407 and IVY-1244.

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

You get the correct name using pattern "[artifact]-[revision](-[classifier]).[ext]" 😉 but that does not fix the bug.

@sutchark
Copy link

sutchark commented Mar 1, 2018

http://central.maven.org/maven2/org/lwjgl/lwjgl/3.1.2/lwjgl-3.1.2.jar

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

What you download is lwjgl-3.1.2-natives-macos.jar; the dependency lwjgl-3.1.2.jar gets lost.

@sutchark
Copy link

sutchark commented Mar 1, 2018

What is the naming sceme you suggested fixing?:
String pattern = destFolder + "/[organization]/[module]/[type]/[artifact]-[revision](-[classifier]).[ext]";

The dependency lwjgl-3.1.2.jar still gets lost, right? So this is a bug?

@twogee
Copy link
Contributor

twogee commented Mar 1, 2018

Yes, it is. See the list of bug reports above. I'd say we have another blocker, speaking of releases.

@sutchark
Copy link

sutchark commented Mar 2, 2018

Thanks for your help.

P.S.: Maybe one pre-release test should download an extensive list of dependencies with Ivy and compare them to what Maven or Gradle is getting.

@chinhodado
Copy link
Contributor Author

Unrelated, but maybe you should consider enabling the issue tracker here on github.

@chinhodado chinhodado closed this Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants