Re: maven-enforcer-plugin rules question

2017-01-18 Thread Martin Gainty
i found plugin that appears to address class-cycle issues found in class files


http://classycle.sourceforge.net/

Classycle
classycle.sourceforge.net
Home; Examples; Download; User Guide; API documentation; SourceForge project 
page. powered by : Classycle: Analysing Tools for Java Class and Package 
Dependencies


Using this exmaple:


public class ClassA
{
 public de.andrena.tools.nopackagecycles.ClassB classB=null; //detect this 
class cycle
}

public class ClassB extends ClassA
{
 public ClassA classA=null; //this is OK as it is Base Class
}



produces this xml output:



  
 
  
  



  
  



I'll need to factor in some xslt magic to find cycle but I think we have a 
delta detected by this plugin


thanks all,

Martin
__




From: Martin Gainty 
Sent: Tuesday, January 10, 2017 12:05 PM
To: Maven Users List
Subject: Re: maven-enforcer-plugin rules question


i couldnt get it this cycle failure:

Test set: de.andrena.tools.nopackagecycles.PackageCycleCollectorPerformanceTest
---
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.133 sec - in 
de.andrena.tools.nopackagecycles.PackageCycleCollectorPerformanceTest



package de.andrena.tools.nopackagecycles;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import jdepend.framework.JavaPackage;
import org.junit.Before;
import org.junit.Test;
import de.andrena.tools.nopackagecycles.ClassB;

public class ClassB extends ClassA
{
 public ClassA classA=null; //OK
}



public class PackageCycleCollectorPerformanceTest {


//add one obvious cycle


public void findRealPackageCycle() throws Exception {
JavaPackage javaPackage =new JavaPackage("de.andrena.tools.nopackagecycles");
JavaClass javaClassA=new JavaClass("ClassA");
javaPackage.addClass(javaClassA);
JavaClass javaClassB=new JavaClass("ClassB");
javaPackage.addClass(javaClassB);
allPackages.add(javaPackage);
   List cycles = new 
PackageCycleCollector().collectCycles(allPackages);
assertThat(cycles, is(empty()));
}
...
}


package de.andrena.tools.nopackagecycles;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import jdepend.framework.JavaPackage;
import org.junit.Before;
import org.junit.Test;
import de.andrena.tools.nopackagecycles.ClassB;
public class ClassA
{
 public de.andrena.tools.nopackagecycles.ClassB classB=null; //detect this 
cycle!
}


what am i doing wrong?


Thanks Curtis

Martin
__



From: ctrueden.w...@gmail.com  on behalf of Curtis 
Rueden 
Sent: Tuesday, January 10, 2017 11:02 AM
To: Maven Users List
Subject: Re: maven-enforcer-plugin rules question

Hi Martin,

A quick Google search revealed this:
https://github.com/andrena/no-package-cycles-enforcer-rule
[https://avatars2.githubusercontent.com/u/1824230?v=3=400]

GitHub - andrena/no-package-cycles-enforcer-rule 
...
github.com
no-package-cycles-enforcer-rule - Shamelessly copied and improved from 
http://stackoverflow.com/questions/3416547/maven-jdepend-fail-build-with-cycles




I haven't tried it personally. Though now that I know about it, I'm sorely
tempted-it would certainly improve the API design.

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
[https://gravatar.com/avatar/63df759e2779af56fd050a968ff98d09]

User:Rueden - ImageJ
imagej.net
What is Curtis working on? Primary projects. Here is a summary of my current 
projects, in priority order. I try to keep this list up to date. The ImageJ2 
paper.





On Tue, Jan 10, 2017 at 9:34 AM, Martin Gainty  wrote:

> I need to detect package cycles such as what is seen here:
>
> class ClassA
>
> {
>
>  ClassB classB; //detect this package cycle!
>
> }
> class ClassB extends ClassA
>
> {
>
> }
>
>
> which maven-enforcer-plugin rule will allow me to detect package cycle?
>
>
> http://maven.apache.org/enforcer/enforcer-rules/index.html
Apache Maven Enforcer Rules - Standard 

Re: Is it time to change the defaults for source and target?

2017-01-18 Thread Thomas Broyer
One shouldn't ever use source/target without also setting a corresponding
bootclasspath (and Java 8 displays a warning when that's not the case; as
it could lead to code that doesn't actually run on the targeted JVM), so
those settings should have NO default value.
Java 9 will make it better with real cross-compilation without the need for
a bootclasspath (with its new -release argument), but it's not there yet.

Le mer. 18 janv. 2017 16:38, Russell Gold  a
écrit :

Currently, the maven-compiler-plugin defaults to 1.5 for the values of
“source” and “target.” But Java 1.5 was end-of-lifed some time ago, and
Maven doesn’t even run with lower than 1.6. These settings are incompatible
with Java 9. Would it not make sense now to change those defaults to at
least 1.6, if not 1.7?
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


Re: Is it time to change the defaults for source and target?

2017-01-18 Thread Russell Gold
The rule is three-back. If you run Maven with Java 9 and do not set target and 
source (or release) explicitly, it uses the default of 1.5, which the compiler 
rejects with

[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.

 Russ

> On Jan 18, 2017, at 3:30 PM, Jochen Wiedmann  
> wrote:
> 
> On Wed, Jan 18, 2017 at 4:37 PM, Russell Gold  wrote:
> 
>> These settings are incompatible with Java 9.
> 
> How so?
> 
> 
> 
> -- 
> The next time you hear: "Don't reinvent the wheel!"
> 
> http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 



Re: Is it time to change the defaults for source and target?

2017-01-18 Thread Jochen Wiedmann
On Wed, Jan 18, 2017 at 4:37 PM, Russell Gold  wrote:

> These settings are incompatible with Java 9.

How so?



-- 
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg

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



ApacheCon CFP closing soon (11 February)

2017-01-18 Thread Rich Bowen
Hello, fellow Apache enthusiast. Thanks for your participation, and
interest in, the projects of the Apache Software Foundation.

I wanted to remind you that the Call For Papers (CFP) for ApacheCon
North America, and Apache: Big Data North America, closes in less than a
month. If you've been putting it off because there was lots of time
left, it's time to dig for that inspiration and get those talk proposals in.

It's also time to discuss with your developer and user community whether
there's a track of talks that you might want to propose, so that you
have more complete coverage of your project than a talk or two.

We're looking for talks directly, and indirectly, related to projects at
the Apache Software Foundation. These can be anything from in-depth
technical discussions of the projects you work with, to talks about
community, documentation, legal issues, marketing, and so on. We're also
very interested in talks about projects and services built on top of
Apache projects, and case studies of how you use Apache projects to
solve real-world problems.

We are particularly interested in presentations from Apache projects
either in the Incubator, or recently graduated. ApacheCon is where
people come to find out what technology they'll be using this time next
year.

Important URLs are:

To submit a talk for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/program/cfp
To submit a talk for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/program/cfp

To register for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/attend/register-
To register for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/attend/register-

Early Bird registration rates end March 12th, but if you're a committer
on an Apache project, you get the low committer rate, which is less than
half of the early bird rate!

For further updated about ApacheCon, follow us on Twitter, @ApacheCon,
or drop by our IRC channel, #apachecon on the Freenode IRC network. Or
contact me - rbo...@apache.org - with any questions or concerns.

Thanks!

Rich Bowen, VP Conferences, Apache Software Foundation

-- 
(You've received this email because you're on a dev@ or users@ mailing
list of an Apache Software Foundation project. For subscription and
unsubscription information, consult the headers of this email message,
as this varies from one list to another.)

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



Is it time to change the defaults for source and target?

2017-01-18 Thread Russell Gold
Currently, the maven-compiler-plugin defaults to 1.5 for the values of “source” 
and “target.” But Java 1.5 was end-of-lifed some time ago, and Maven doesn’t 
even run with lower than 1.6. These settings are incompatible with Java 9. 
Would it not make sense now to change those defaults to at least 1.6, if not 
1.7?
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org