-
Notifications
You must be signed in to change notification settings - Fork 17
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
Maven conversion #9
Conversation
Deleted hard coded depenedencies. Updated log4j2 and jna to latest from maven central
Deprecated old log4j 1.x configuration Added temporal readme
@@ -185,7 +181,7 @@ public void activateOptions() { | |||
registerEventSource(); | |||
} | |||
|
|||
@Override | |||
//@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this, don't comment out.
First, excellent work. Thanks. I really want this in, so lets work through the remaining items. I think you're spot on of what's next. I would merge this as soon as the top of the build works with maven, so |
Thanks. The parent project is under way. I can try to complete the list by the end of this week. Is there a we server where to publish a maven site or should we modify the top readme.md file with instructions on how to use teh jar and run the demo? I'll let you know when the parent project is ready and the clean up completed. |
We've never published log4jna into maven central, #6 has been open for a while. Would appreciate your help with getting that setup, but that doesn't have to happen in the same PR, feel free to do it next. Definitely modify README. Whatever keeps the project in a consistent state. |
After we get this merged I'll want you to join the maintainers list, so you can make the first maven release if you're interested ;) |
I think I can do the deployment, |
On another note I'm very tempted to delete the "System.err(...)" lines from the code, they pollute the console and it looks that was place there for some debugging that is not necessary any more. |
After thought: |
I don't think |
I have been doing some reading about how to publish to Maven Central. Only ASF projects can publish directly to it. Other open source projects must use a staging repository and do a promotion to central. The usual way to do it is to open an account with Sonatype's Nexus OSSRH and promote from there. We have to open a Jira account for the top level coordinates for the project I don't think that the package That way we will be able to differentiate log4jna from other ASF projects. Using the dependencies will look like this in a pom.xml
|
I'm down with anything, but lets focus on first steps, getting this thing to build and work with maven all the way? |
I think we are ready to test the build.
You will get all the jars in each project plus the dll in the new win32dll separated project, In the assembly project you will find a distributable zip file with all the documentation and the jars and dll in the /lib directory The documentation stills is work in progress, I want to replace it with the maven site and update the *.md files to reflect the changes. I renamed the location of log4jna to log4jna-api to allow for a top level log4jna with documentation for all the project. I did not changed the project layout in git just used the name in the pom to rename the api jar. |
I don't see a |
Did you try to run it on the parent project using There is no intention of having a pom.xml on the root of the repository, I'm using the concept of parent project and relative sub projects. The root of the repository becomes a place for readme and instructions on github documentation format, but is not part of the build. I can change this if you want. DO the errors refer to repositories or distribution management problems? |
On another topic, I started the procedure to get access to Sonatypet and Maven Central. See this: I think that we should go with |
Lets back up just a little and not get side tracked by future tasks and try to finish this PR ;) First, we want a build from "the top". Maybe that means modifying Look at https://github.com/dblock/oshi, that team has done a great job with mavenizing it. |
That's easy to do, all I have to do is to move parent to the top and delete parent. Thinking on having a repository where to deploy the SNAPSHOT buil is not much about side tracking as it is about testing how the deploy command in mvn works. In my mind with library projects, Maven final objective is to deploy to its repositories. |
Done, To build running the tests the registry entries Run If you have errors, please provide a sample, I checked out the project in a clean machine and found no problems with the build. |
Making progress! Failed for me with this:
Also:
|
I don't remember needing to do anything by hand to get tests to pass - is this something new or maybe you just need to be admin to run the build since those registry keys can't otherwise be created? |
Do you have Java 8 installed? The build requires Java 8. Yes the registry requirement is because of the elevated privileges to write the keys. I tested Windows 7 and 10 with cmd as admin and can't make it work. The log4jna-api uses The demo has a log4j2-application.xml that can be renamed to use I did this to demonstrate that now yo can write anywhere in the EventLog.. |
As far as I know there is no way of running mvn without a parameter. The nature of Maven is that you have to specify a goal or life-cycle target. I'm waiting for this to work for you to update the change-log and readme.md |
BTW I just added The constructor uses them to create the registry values: |
Yes, I have
I don't think we can ask people to create registry keys for tests. You can just create them in setup of the test or something like that, and skip the tests if you're not running as admin. |
Which version of Maven are you running? From oshi pom: Maven minimum version 3.2.3. I think that requiring to set the registry is not a big deal. |
I think I find where your compilation error is coming from. You might have and old JDK prior to Java 8. Check javac -version and change your %JAVA_HOME% to the proper JDK. Is not the version of |
Yep, that worked. Sorry about that, I don't do much Java development these days. Thanks for contributing this! I think the next important step now that it's mavenized, and before trying to release to Maven central, is to get a working AppVeyor build here for future PRs. I opened #10. I found http://www.yegor256.com/2015/01/10/windows-appveyor-maven.html, and enabled the build on https://ci.appveyor.com/project/dblock/log4jna. You should be able to make pull requests and getting those to green. Would you like to give it a shot? |
Opened #11 wrt changing the namespace. |
I also opened #13 to create a RELEASING.md document, and linked one from another project that uses Maven central. |
I just checked in the initial work
It stills is in a pretty untidy state, as I only converted the demo and log4jna projects to Maven and made them fully log4j 2 compliant. I still have to do more clean up.
Done so far:
Replaced all dependencies on log4j2 and jna with latest versions from Maven Central in the pom.xml
Replaced some deprecated methods with the recommended replacement.
Updated the projects to Java 8.
Added the dll as a resource to avoid copying or building it to run the tests or the demo application.
Locally I can use the dll as a Maven dependency from my internal Nexus repository.
Some Ideas:
Extract the dll build to its own sub project and keep a minimal ant build for it
Replace the ant build for a full fledged Maven build with a parent project.
Deprecate and eliminate the thirdparty sub project as all dependencies now come from Maven Central.
Distribute the dll from Maven Central for end users.
Create a Maven site with all the documentation on how to use and how to collaborate with the project.