Integrating maven with other tooling

2016-05-29 Thread James Roper
Hi all,

I'm looking to write some tooling that integrates with maven by
programatically interrogating the build to get, for example, a list of
projects, their transitive dependencies, etc.  What I don't want to do is
reimplement maven - I don't want to parse the pom file myself and resolve
dependencies myself.  So I'd like to programatically instantiate maven and
ask it questions about the structure and state of the build.

The main entry point into Maven seems to be MavenCli, but its public
method, doMain(), simply returns an integer return code, which is no use
for programmatic interrogation.  So, in order to programatically
interrogate a maven build, eg get the list of projects, resolve the
dependencies etc, I think I have to completely copy most of the code in
MavenCli, which is a lot of code including a lot of implementation detail
that seems like something that tooling shouldn't have to be concerned with,
and is potentially quite fragile to future changes in Maven.  So far I've
done this and it's at least partially working, but it just feels so wrong.
Is there any simpler/safer way to do this?

I guess I could create a maven plugin that captured the state that I want
to return back to my tooling in a static variable after submitting an
execution request to MavenCli that executed a task provided by the plugin,
but that seems like a very hacky way of doing things - is there any API
that would allow me to simply ask maven for a fully initialized plexus
container, for example?  How do other tools do this kind of integration, eg
Eclipse or IntelliJ?

Cheers,

James

-- 
*James Roper*
*Software Engineer*

Lightbend  – Build reactive apps!
Twitter: @jroper 


Re: Strange GIT

2016-05-29 Thread Fred Cooke
I take that back. In a single blow, you changed the entire file! Why?
Because since that file was created on Christmas eve 2015, it has had
broken line endings. Fix up the line endings and move on.

On Mon, May 30, 2016 at 4:20 PM, Fred Cooke  wrote:

> I cloned it, assuming you're talking about the linked hash, which is the
> tip/head of master, then the diff shown is correct, you moved the package
> declaration around under the auspices of "investigating". Your change must
> be in an earlier commit. I looked at a few, but gave up.
>
> On Mon, May 30, 2016 at 4:05 PM, Tibor Digana  > wrote:
>
>> Hi all,
>>
>> The Git/GitHub diff does not show me real changes [1] I made.
>> Our Jenkins CI does not update the Maven project with these changes.
>>
>> What's going on wrong?
>> I am using git 1.9.5.0.msysgit.0.
>>
>> The content [2] on GitHub contains my changes but the diff does not.
>>
>> [1]
>>
>> https://github.com/apache/maven-surefire/commit/ce3bdd50678c1e83efe55a1f243631dedac01921#diff-dadf82ac2a525e3b95545bb671364989
>>
>> [2]
>>
>> https://github.com/apache/maven-surefire/blob/ce3bdd50678c1e83efe55a1f243631dedac01921/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1211JUnitTestNgIT.java
>>
>> I have added several lines of the change:
>>
>> @Before
>> public void before() {
>> System.out.println( "java.specification.version: " + getProperty(
>> "java.specification.version" ) );
>> System.err.println( "java.specification.version: " + getProperty(
>> "java.specification.version" ) );
>> }
>>
>>
>>
>> --
>> Cheers
>> Tibor
>>
>
>


Re: Strange GIT

2016-05-29 Thread Fred Cooke
I cloned it, assuming you're talking about the linked hash, which is the
tip/head of master, then the diff shown is correct, you moved the package
declaration around under the auspices of "investigating". Your change must
be in an earlier commit. I looked at a few, but gave up.

On Mon, May 30, 2016 at 4:05 PM, Tibor Digana 
wrote:

> Hi all,
>
> The Git/GitHub diff does not show me real changes [1] I made.
> Our Jenkins CI does not update the Maven project with these changes.
>
> What's going on wrong?
> I am using git 1.9.5.0.msysgit.0.
>
> The content [2] on GitHub contains my changes but the diff does not.
>
> [1]
>
> https://github.com/apache/maven-surefire/commit/ce3bdd50678c1e83efe55a1f243631dedac01921#diff-dadf82ac2a525e3b95545bb671364989
>
> [2]
>
> https://github.com/apache/maven-surefire/blob/ce3bdd50678c1e83efe55a1f243631dedac01921/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1211JUnitTestNgIT.java
>
> I have added several lines of the change:
>
> @Before
> public void before() {
> System.out.println( "java.specification.version: " + getProperty(
> "java.specification.version" ) );
> System.err.println( "java.specification.version: " + getProperty(
> "java.specification.version" ) );
> }
>
>
>
> --
> Cheers
> Tibor
>


Strange GIT

2016-05-29 Thread Tibor Digana
Hi all,

The Git/GitHub diff does not show me real changes [1] I made.
Our Jenkins CI does not update the Maven project with these changes.

What's going on wrong?
I am using git 1.9.5.0.msysgit.0.

The content [2] on GitHub contains my changes but the diff does not.

[1]
https://github.com/apache/maven-surefire/commit/ce3bdd50678c1e83efe55a1f243631dedac01921#diff-dadf82ac2a525e3b95545bb671364989

[2]
https://github.com/apache/maven-surefire/blob/ce3bdd50678c1e83efe55a1f243631dedac01921/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1211JUnitTestNgIT.java

I have added several lines of the change:

@Before
public void before() {
System.out.println( "java.specification.version: " + getProperty(
"java.specification.version" ) );
System.err.println( "java.specification.version: " + getProperty(
"java.specification.version" ) );
}



-- 
Cheers
Tibor


Re: maven-wagon git commit: [WAGON-457] Wagon tests fail on Windows because Subversion crashes on a test repo

2016-05-29 Thread Robert Scholte

That did the trick, great!

Robert

On Sun, 29 May 2016 20:12:20 +0200, Michael Osipov   
wrote:



Am 2016-05-29 um 09:26 schrieb Robert Scholte:

I'm having issues with maven-scm-provider-svntest when used by the
maven-scm-plugin.
Could this fix help there as well?


You are probably talking about this file:  
https://github.com/apache/maven-scm/blob/maven-scm-1.9.4/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resources/tck/tck.dump


The dump has been normalized by Git which basically means this file has  
been destroyed. Try LF only and rerun the tests. If this works, commit  
it and add .gitattributes.


So, yes this might fix your problem too.

Michael


On Sat, 28 May 2016 23:56:06 +0200,  wrote:


Repository: maven-wagon
Updated Branches:
  refs/heads/master f3462c3f2 -> 6df8f317f


[WAGON-457] Wagon tests fail on Windows because Subversion crashes on
a test repo


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit:
http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/6df8f317
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/6df8f317
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/6df8f317

Branch: refs/heads/master
Commit: 6df8f317f083856c42d4274c233d491fe3a5eb35
Parents: f3462c3
Author: Michael Osipov 
Authored: Sat May 28 23:55:15 2016 +0200
Committer: Michael Osipov 
Committed: Sat May 28 23:55:15 2016 +0200

--
 .../wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes  | 3
+++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/6df8f317/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

--
diff --git
a/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

new file mode 100644
index 000..ac0cab2
--- /dev/null
+++
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

@@ -0,0 +1,3 @@
+# Make all files end with LF even on Windows because Subversion
+# internal files are platform-neutral encoded with linefeed only.
+* eol=lf


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Merging maven-release-plugin config

2016-05-29 Thread Michael Osipov

Thanks for the clarification!

I will leave it as-is.

Michael

Am 2016-05-29 um 11:14 schrieb Christopher:

For what it's worth, they are *not* equivalent:

The  element only applies to the release:perform goal,
not the release:prepare goal. , on the other hand gets used by
both goals.

Thus, the ASF parent has activated the apache-release profile on both
goals, and the Maven parent only activates it for the release:perform goal,
presumably to save on some additional work during the preparation step
(speculation) at the possible cost of delayed notification of problems
which might arise in executing the plugins in that profile.

On Sat, May 28, 2016 at 5:19 AM Hervé BOUTEMY  wrote:


+1

Regards,

Hervé

Le samedi 28 mai 2016 00:42:00 Michael Osipov a écrit :

Hi folks,

I just have noticed that ASF Parent says:


   org.apache.maven.plugins
   maven-release-plugin
   2.5.3
   
 ...
 -Papache-release ${arguments}
 ..
   


and Maven Parent:


   org.apache.maven.plugins
   maven-release-plugin
   
 ...
 apache-release
 ...
 ${arguments}
   


Both seem equivalent to me. it safe to remove those two properties from
Maven Parent?

Michael

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org








-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: maven-wagon git commit: [WAGON-457] Wagon tests fail on Windows because Subversion crashes on a test repo

2016-05-29 Thread Michael Osipov

Am 2016-05-29 um 09:26 schrieb Robert Scholte:

I'm having issues with maven-scm-provider-svntest when used by the
maven-scm-plugin.
Could this fix help there as well?


You are probably talking about this file: 
https://github.com/apache/maven-scm/blob/maven-scm-1.9.4/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resources/tck/tck.dump


The dump has been normalized by Git which basically means this file has 
been destroyed. Try LF only and rerun the tests. If this works, commit 
it and add .gitattributes.


So, yes this might fix your problem too.

Michael


On Sat, 28 May 2016 23:56:06 +0200,  wrote:


Repository: maven-wagon
Updated Branches:
  refs/heads/master f3462c3f2 -> 6df8f317f


[WAGON-457] Wagon tests fail on Windows because Subversion crashes on
a test repo


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit:
http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/6df8f317
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/6df8f317
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/6df8f317

Branch: refs/heads/master
Commit: 6df8f317f083856c42d4274c233d491fe3a5eb35
Parents: f3462c3
Author: Michael Osipov 
Authored: Sat May 28 23:55:15 2016 +0200
Committer: Michael Osipov 
Committed: Sat May 28 23:55:15 2016 +0200

--
 .../wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes  | 3
+++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/6df8f317/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

--
diff --git
a/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

new file mode 100644
index 000..ac0cab2
--- /dev/null
+++
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

@@ -0,0 +1,3 @@
+# Make all files end with LF even on Windows because Subversion
+# internal files are platform-neutral encoded with linefeed only.
+* eol=lf


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Plexus Archiver Version 3.3 Released

2016-05-29 Thread Karl Heinz Marbaise

Hi to all,

a new release of the plexus-archiver (3.3) has been released.

The release Notes can be found here:

https://github.com/codehaus-plexus/plexus-archiver/blob/master/ReleaseNotes.md#release-33

The new updated site:

http://codehaus-plexus.github.io/plexus-archiver/

Note: Synch to central could take a few hours.

Kind regards
Karl Heinz Marbaise


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Merging maven-release-plugin config

2016-05-29 Thread Christopher
For what it's worth, they are *not* equivalent:

The  element only applies to the release:perform goal,
not the release:prepare goal. , on the other hand gets used by
both goals.

Thus, the ASF parent has activated the apache-release profile on both
goals, and the Maven parent only activates it for the release:perform goal,
presumably to save on some additional work during the preparation step
(speculation) at the possible cost of delayed notification of problems
which might arise in executing the plugins in that profile.

On Sat, May 28, 2016 at 5:19 AM Hervé BOUTEMY  wrote:

> +1
>
> Regards,
>
> Hervé
>
> Le samedi 28 mai 2016 00:42:00 Michael Osipov a écrit :
> > Hi folks,
> >
> > I just have noticed that ASF Parent says:
> >
> > 
> >org.apache.maven.plugins
> >maven-release-plugin
> >2.5.3
> >
> >  ...
> >  -Papache-release ${arguments}
> >  ..
> >
> > 
> >
> > and Maven Parent:
> >
> > 
> >org.apache.maven.plugins
> >maven-release-plugin
> >
> >  ...
> >  apache-release
> >  ...
> >  ${arguments}
> >
> > 
> >
> > Both seem equivalent to me. it safe to remove those two properties from
> > Maven Parent?
> >
> > Michael
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > For additional commands, e-mail: dev-h...@maven.apache.org
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


Re: maven-wagon git commit: [WAGON-457] Wagon tests fail on Windows because Subversion crashes on a test repo

2016-05-29 Thread Robert Scholte
I'm having issues with maven-scm-provider-svntest when used by the  
maven-scm-plugin.

Could this fix help there as well?

thanks,
Robert

On Sat, 28 May 2016 23:56:06 +0200,  wrote:


Repository: maven-wagon
Updated Branches:
  refs/heads/master f3462c3f2 -> 6df8f317f


[WAGON-457] Wagon tests fail on Windows because Subversion crashes on a  
test repo



Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit:  
http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/6df8f317

Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/6df8f317
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/6df8f317

Branch: refs/heads/master
Commit: 6df8f317f083856c42d4274c233d491fe3a5eb35
Parents: f3462c3
Author: Michael Osipov 
Authored: Sat May 28 23:55:15 2016 +0200
Committer: Michael Osipov 
Committed: Sat May 28 23:55:15 2016 +0200

--
 .../wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes  | 3  
+++

 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/6df8f317/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes
--
diff --git  
a/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes  
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

new file mode 100644
index 000..ac0cab2
--- /dev/null
+++  
b/wagon-providers/wagon-scm/src/test/resources/test-repo-svn/db/.gitattributes

@@ -0,0 +1,3 @@
+# Make all files end with LF even on Windows because Subversion
+# internal files are platform-neutral encoded with linefeed only.
+* eol=lf


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org