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

Can not add Tinylog to Maven project because the dependency is a .zip on Maven Central #55

Closed
nureyev opened this issue Aug 3, 2017 · 7 comments
Assignees

Comments

@nureyev
Copy link

nureyev commented Aug 3, 2017

It is not possible to add Tinylog 1.2 to a Maven-based project since Maven does not set dependencies to the classpath correctly when they are in .zip format.

Would it be possible to upload a .jar to Maven Central please?

Thanks for the project and your time.

@nureyev
Copy link
Author

nureyev commented Aug 3, 2017

Doing a manual install to the local repository works, but might not be the best solution.

Update: The following workaround fetches the artifact from Maven Central and installs correctly:

Add the dependency to pom.xml but change <type>zip</type> to <type>jar</type>

<dependency>
    <groupId>org.tinylog</groupId>
    <artifactId>tinylog</artifactId>
    <version>1.2</version>
    <type>jar</type>
</dependency>

@pmwmedia pmwmedia self-assigned this Aug 6, 2017
@pmwmedia
Copy link
Member

pmwmedia commented Aug 6, 2017

Which IDE and Maven version are you using? I have tried to reproduce the problem with a clean and empty Maven repository. Maven 3.3.3 on Eclipse has automatically fetched and downloaded the tinylog JAR and no ZIP file.

My POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>example</groupId>
  <artifactId>app</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
  	<dependency>
  		<groupId>org.tinylog</groupId>
  		<artifactId>tinylog</artifactId>
  		<version>1.2</version>
  	</dependency>
  </dependencies>
</project>

tinylog files downloaded by Maven:

tinylog-1.2.jar
tinylog-1.2.jar.sha1
tinylog-1.2.pom
tinylog-1.2.pom.sha1

Did you write <type>zip</type> in your pom.xml before? In this case it would be correct that Maven has downloaded a ZIP file as it was requested. Usually I don't define the type, because Maven chooses JAR by default.

@nureyev
Copy link
Author

nureyev commented Aug 6, 2017

Thanks for the reply.

NetBeans 8.2 (all plugins updated as of today)
Maven 3.5.0
maven-dependency-plugin:2.6
maven-resources-plugin:2.6
maven-compiler-plugin:3.1

When you right-click on Dependencies in the Project window and click Add Dependency... to add in Tinylog, it is possible NetBeans is filling in an inappropriate <type>, which Eclipse does not do.

My workaround was to change the type in the Add dependency dialog from the default of zip to jar after I ran the query to download Tinylog from the Maven Central remote repository.

add_dependency

@pmwmedia
Copy link
Member

pmwmedia commented Aug 6, 2017

Thank you! I will analyze the behavior of Netbeans. Maybe I'm going to remove the ZIP archive from Maven Central Repository.

@pmwmedia
Copy link
Member

pmwmedia commented Aug 7, 2017

I just tested it on my computer with Netbeans 8.2. Fresh download from: https://netbeans.org/downloads/start.html?platform=zip&lang=en&option=javase. On my computer, Netbeans leaves the type empty and downloads the tinylog JAR.

Update: Netbeans uses ZIP type, if you use the search, but the default JAR type, if you use the autocomplete function in the form itself.

@pmwmedia
Copy link
Member

Solved with release of tinylog 1.3 rc1.

@github-actions
Copy link

github-actions bot commented Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants