You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dave Newton <da...@gmail.com> on 2010/08/21 21:59:06 UTC

[maven/intellij] Still fighting Maven and/or IntelliJ

Current trunk.

Normal IntelliJ Maven project setup, but it refuses to deal with the XWork
package renaming, and I have no idea (harhar) why not. The correct classes
are in the XWork jar in the repo
(like org.apache.commons.lang.xwork.StringUtils), but IntelliJ doesn't see
it and continues to try to grab IDEA's compilation results.

I've tried the typical random stuff, like (cmdline) rebuilding, (IntelliJ)
force reimporting, (IntelliJ) reloading folders, whatever other stuff I
could find that seemed even reasonably close.

If I have a project with *just* s2-core, everything works, I assume because
the XWork stuff isn't in the current project, but I had kind of wanted to
have everything "local".

Anybody dealt/fixed with this before?

Thanks,
Dave

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Dave Newton <da...@gmail.com>.
This is what I ended up doing, actually--I couldn't figure anything else
out, so finally just gave up :)

On Mon, Sep 27, 2010 at 7:40 PM, Maurizio Cucchiara <
maurizio.cucchiara@gmail.com> wrote:

> Dave,
> are you still fighting? :)
> Sorry, I thought you working in local copy only.
> Unfortunately, intellij usually looks first for module dependency. If you
> try to remove xwork-core from module dependency you can't debug xwork-core.
> I find out a workaround, it allows to compile and debug without any side
> effects.
>
> Create a new project library (file -> project structure -> libraries -> add
> new library) that point to
>
> your_repository_path/org/apache/struts/xwork/xwork-core/2.2.2-SNAPSHOT/xwork-core-2.2.2-SNAPSHOT.jar
> (this is the only place where idea can find out the shaded classes).
> Then add project library in every module that already contains xwork-core
> module dependency.
> If you try to compile now idea should be able to do. You'll also able to
> debug the xwork-core (except for common.lang part).
>
> I hope I have explained it well.
>
> Maurizio Cucchiara
>
> PS: when you edit xwork source, remember to launch mvn install in xwork dir
> to upgrade repository version.
>

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Dave,
are you still fighting? :)
Sorry, I thought you working in local copy only.
Unfortunately, intellij usually looks first for module dependency. If you
try to remove xwork-core from module dependency you can't debug xwork-core.
I find out a workaround, it allows to compile and debug without any side
effects.

Create a new project library (file -> project structure -> libraries -> add
new library) that point to
your_repository_path/org/apache/struts/xwork/xwork-core/2.2.2-SNAPSHOT/xwork-core-2.2.2-SNAPSHOT.jar
(this is the only place where idea can find out the shaded classes).
Then add project library in every module that already contains xwork-core
module dependency.
If you try to compile now idea should be able to do. You'll also able to
debug the xwork-core (except for common.lang part).

I hope I have explained it well.

Maurizio Cucchiara

PS: when you edit xwork source, remember to launch mvn install in xwork dir
to upgrade repository version.

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Dave Newton <da...@gmail.com>.
I'll see what's in there and give it a shot if it seems reasonable.

I just can't figure out why it's not taking the shaded classes from the repo
jar... *grr*

Thanks,
Dave

On Sat, Aug 21, 2010 at 4:11 PM, Kristian Rosenvold <
kristian.rosenvold@gmail.com> wrote:

> I quite often delete the full "system" folder under ~/.IntelliJIdea90
> when I get this kind of behaviour. Don't know if it helps in this case.
>
> Regards,
>
> Kristian Rosenvold
>
>
> lø., 21.08.2010 kl. 15.59 -0400, skrev Dave Newton:
> > Current trunk.
> >
> > Normal IntelliJ Maven project setup, but it refuses to deal with the
> XWork
> > package renaming, and I have no idea (harhar) why not. The correct
> classes
> > are in the XWork jar in the repo
> > (like org.apache.commons.lang.xwork.StringUtils), but IntelliJ doesn't
> see
> > it and continues to try to grab IDEA's compilation results.
> >
> > I've tried the typical random stuff, like (cmdline) rebuilding,
> (IntelliJ)
> > force reimporting, (IntelliJ) reloading folders, whatever other stuff I
> > could find that seemed even reasonably close.
> >
> > If I have a project with *just* s2-core, everything works, I assume
> because
> > the XWork stuff isn't in the current project, but I had kind of wanted to
> > have everything "local".
> >
> > Anybody dealt/fixed with this before?
> >
> > Thanks,
> > Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Kristian Rosenvold <kr...@gmail.com>.
I quite often delete the full "system" folder under ~/.IntelliJIdea90
when I get this kind of behaviour. Don't know if it helps in this case.

Regards, 

Kristian Rosenvold


lø., 21.08.2010 kl. 15.59 -0400, skrev Dave Newton:
> Current trunk.
> 
> Normal IntelliJ Maven project setup, but it refuses to deal with the XWork
> package renaming, and I have no idea (harhar) why not. The correct classes
> are in the XWork jar in the repo
> (like org.apache.commons.lang.xwork.StringUtils), but IntelliJ doesn't see
> it and continues to try to grab IDEA's compilation results.
> 
> I've tried the typical random stuff, like (cmdline) rebuilding, (IntelliJ)
> force reimporting, (IntelliJ) reloading folders, whatever other stuff I
> could find that seemed even reasonably close.
> 
> If I have a project with *just* s2-core, everything works, I assume because
> the XWork stuff isn't in the current project, but I had kind of wanted to
> have everything "local".
> 
> Anybody dealt/fixed with this before?
> 
> Thanks,
> Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Maurizio Cucchiara <ma...@gmail.com>.
2010/8/22 Dave Newton <da...@gmail.com>

> On Sat, Aug 21, 2010 at 8:48 PM, Maurizio Cucchiara wrote:
>
> > there isn't any  or other stuff.
>
>
> Of course there is--it's what's created by the shading. For example:
>
>
> http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionError.java?view=markup
>
>


> Look at line 29, which reads:
>
> import org.apache.commons.lang.xwork.StringUtils;
>
>
I'll try to explain better: look at
http://commons.apache.org/lang/api-2.3/org/apache/commons/lang/StringUtils.html.
This is your org.apache.commons.lang.xwork.StringUtils. What really happened
is that Maven "shades" apache common's StringUtils.

Maurizio

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Dave Newton <da...@gmail.com>.
On Sat, Aug 21, 2010 at 8:48 PM, Maurizio Cucchiara wrote:

> there isn't any org.apache.commons.lang.xwork.StringUtils or other stuff.


Of course there is--it's what's created by the shading. For example:

http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionError.java?view=markup

Look at line 29, which reads:

import org.apache.commons.lang.xwork.StringUtils;

> I know it's terrible, but I simply replace all
> org.apache.commons.lang.xwork. with org.apache.commons.lang. and it works
> like a charm.
>

...

"Just" replacing all XWork usages with Commons usage isn't really an option;
I'm not just dealing with a local build here.

Dave

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Hi Dave,
there isn't any org.apache.commons.lang.xwork.StringUtils or other stuff. If
you take a look at xwork pom
file<http://svn.opensymphony.com/svn/xwork/trunk/core/pom.xml> you'll
see that it contains maven shade
plugin<http://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html>
's code.

I know it's terrible, but I simply replace
all org.apache.commons.lang.xwork. with org.apache.commons.lang. and it
works like a charm.

I hope this will help you.

2010/8/21 Dave Newton <da...@gmail.com>

> Current trunk.
>
> Normal IntelliJ Maven project setup, but it refuses to deal with the XWork
> package renaming, and I have no idea (harhar) why not. The correct classes
> are in the XWork jar in the repo
> (like org.apache.commons.lang.xwork.StringUtils), but IntelliJ doesn't see
> it and continues to try to grab IDEA's compilation results.
>
> I've tried the typical random stuff, like (cmdline) rebuilding, (IntelliJ)
> force reimporting, (IntelliJ) reloading folders, whatever other stuff I
> could find that seemed even reasonably close.
>
> If I have a project with *just* s2-core, everything works, I assume because
> the XWork stuff isn't in the current project, but I had kind of wanted to
> have everything "local".
>
> Anybody dealt/fixed with this before?
>
> Thanks,
> Dave
>

Re: [maven/intellij] Still fighting Maven and/or IntelliJ

Posted by Robert <rl...@apache.org>.
Dave,

If you haven't gotten this to work ...
I am assuming you are using IJ 8,9 or X.
It sounds like the problem is only in IntelliJ and not when you build 
from the command line, correct ?

The Struts IntelliJ project that I see in SVN is struts2\src\main\idea,  
is still being updated, and is this what you are using ?

Have you tried the obvious items such as:
1) Making sure the target/out directory are excluded the project, so the 
jar resolution will not go here first.
2) make sure there that the struts2 module does not have a dependency on 
the xwork-core module.
3) How was XWork installed into your maven repository ?
      Did you build it with IntelliJ then install it or are you using 
the external/apache repo ?
      If you installed it locally from a build were the meta files maven 
creates for local repositories properly created ?
3) Have you tried telling IntelliJ to reindex your local maven repository ?
       This sometimes forces IJ to see those jars.



On 8/21/2010 3:59 PM, Dave Newton wrote:
> Current trunk.
>
> Normal IntelliJ Maven project setup, but it refuses to deal with the XWork
> package renaming, and I have no idea (harhar) why not. The correct classes
> are in the XWork jar in the repo
> (like org.apache.commons.lang.xwork.StringUtils), but IntelliJ doesn't see
> it and continues to try to grab IDEA's compilation results.
>
> I've tried the typical random stuff, like (cmdline) rebuilding, (IntelliJ)
> force reimporting, (IntelliJ) reloading folders, whatever other stuff I
> could find that seemed even reasonably close.
>
> If I have a project with *just* s2-core, everything works, I assume because
> the XWork stuff isn't in the current project, but I had kind of wanted to
> have everything "local".
>
> Anybody dealt/fixed with this before?
>
> Thanks,
> Dave
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 5385 (20100821) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org